Commit a6cbc531 authored by Nicolas Pouillard's avatar Nicolas Pouillard

Let's avoid lists

parent b479e52c
module Gargantext.Utils.List where
import Data.Ord (class Ord, comparing)
import Data.List as List
import Data.Array as Array
import Gargantext.Prelude
-- same as
-- https://github.com/purescript/purescript-arrays/blob/v5.3.1/src/Data/Array.purs#L715-L715
sortWith :: forall a b. Ord b => (a -> b) -> List.List a -> List.List a
sortWith f l = Array.toUnfoldable $ Array.sortBy (comparing f) $ Array.fromFoldable l
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment