Commit 7f36bec4 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[temporary] turn off Data.Sequence, use Data.Array instead

parent 44a83609
...@@ -123,7 +123,7 @@ let additions = ...@@ -123,7 +123,7 @@ let additions =
, "unsafe-coerce" , "unsafe-coerce"
] ]
, repo = "https://github.com/garganscript/purescript-sequences.git" , repo = "https://github.com/garganscript/purescript-sequences.git"
, version = "7ad61fde5239fbf66ceeefc0b7608aa9cbc53701" , version = "recursion-fix"
} }
, spec-discovery = , spec-discovery =
{ dependencies = [ "prelude", "effect", "arrays", "spec", "node-fs" ] { dependencies = [ "prelude", "effect", "arrays", "spec", "node-fs" ]
......
...@@ -2,13 +2,14 @@ module Gargantext.Utils where ...@@ -2,13 +2,14 @@ module Gargantext.Utils where
import Prelude import Prelude
import Data.Array as A
import Data.Char (fromCharCode) import Data.Char (fromCharCode)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (class Foldable, foldr) import Data.Foldable (class Foldable, foldr)
import Data.Lens (Lens', lens) import Data.Lens (Lens', lens)
import Data.Maybe (Maybe(..), fromJust) import Data.Maybe (Maybe(..), fromJust)
import Data.Newtype (class Newtype, unwrap, wrap) import Data.Newtype (class Newtype, unwrap, wrap)
import Data.Sequence.Ordered as OSeq --import Data.Sequence.Ordered as OSeq
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.String as S import Data.String as S
...@@ -100,7 +101,8 @@ sortWith :: forall a b f. Functor f => ...@@ -100,7 +101,8 @@ sortWith :: forall a b f. Functor f =>
Unfoldable f => Unfoldable f =>
Ord b => Ord b =>
(a -> b) -> f a -> f a (a -> b) -> f a -> f a
sortWith f = map (\(On _ y) -> y) <<< OSeq.toUnfoldable <<< foldr (\x -> OSeq.insert (On (f x) x)) OSeq.empty --sortWith f = map (\(On _ y) -> y) <<< OSeq.toUnfoldable <<< foldr (\x -> OSeq.insert (On (f x) x)) OSeq.empty
sortWith f xs = A.toUnfoldable $ A.sortWith f (A.fromFoldable xs)
href :: Effect String href :: Effect String
......
module Data.Sequence where
import Prelude
import Data.Array as A
import Data.Functor as Functor
import Data.Tuple (Tuple(..))
type Seq = Array
cons = A.cons
length = A.length
concatMap = A.concatMap
drop = A.drop
filter = A.filter
map = Functor.map
take = A.take
fromFoldable = A.fromFoldable
toUnfoldable = A.toUnfoldable
empty = []
head = A.head
null = A.null
snoc = A.snoc
singleton = A.singleton
splitAt idx seq = Tuple s.before s.after
where
s = A.splitAt idx seq
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