DataSequence.purs 484 Bytes
Newer Older
1
module Data.SequenceArr where
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

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