foundation-0.0.30: Alternative prelude with batteries and no dependencies

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Foundation.Collection

Description

Different collections (list, vector, string, ..) unified under 1 API. an API to rules them all, and in the darkness bind them.

Synopsis

- class Zippable col => BoxedZippable col where
  - zip :: (Sequential a, Sequential b, Element col ~ (Element a, Element b)) => a -> b -> col
  - zip3 :: (Sequential a, Sequential b, Sequential c, Element col ~ (Element a, Element b, Element c)) => a -> b -> c -> col
  - zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element col ~ (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> col
  - zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element col ~ (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> col
  - zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> col
  - zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> col
  - unzip :: (Sequential a, Sequential b, Element col ~ (Element a, Element b)) => col -> (a, b)
  - unzip3 :: (Sequential a, Sequential b, Sequential c, Element col ~ (Element a, Element b, Element c)) => col -> (a, b, c)
  - unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element col ~ (Element a, Element b, Element c, Element d)) => col -> (a, b, c, d)
  - unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element col ~ (Element a, Element b, Element c, Element d, Element e)) => col -> (a, b, c, d, e)
  - unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => col -> (a, b, c, d, e, f)
  - unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => col -> (a, b, c, d, e, f, g)
- type family Element container
- class InnerFunctor c where
  - imap :: (Element c -> Element c) -> c -> c
- class Foldable collection where
  - foldl' :: (a -> Element collection -> a) -> a -> collection -> a
  - foldr :: (Element collection -> a -> a) -> a -> collection -> a
  - foldr' :: (Element collection -> a -> a) -> a -> collection -> a
- class Foldable f => Fold1able f where
  - foldl1' :: (Element f -> Element f -> Element f) -> NonEmpty f -> Element f
  - foldr1 :: (Element f -> Element f -> Element f) -> NonEmpty f -> Element f
- class Functor collection => Mappable (collection :: Type -> Type) where
  - traverse :: Applicative f => (a -> f b) -> collection a -> f (collection b)
  - sequenceA :: Applicative f => collection (f a) -> f (collection a)
  - mapM :: (Applicative m, Monad m) => (a -> m b) -> collection a -> m (collection b)
  - sequence :: (Applicative m, Monad m) => collection (m a) -> m (collection a)
- traverse_ :: (Mappable col, Applicative f) => (a -> f b) -> col a -> f ()
- mapM_ :: (Mappable col, Applicative m, Monad m) => (a -> m b) -> col a -> m ()
- forM :: (Mappable col, Applicative m, Monad m) => col a -> (a -> m b) -> m (col b)
- forM_ :: (Mappable col, Applicative m, Monad m) => col a -> (a -> m b) -> m ()
- class (IsList c, Item c ~ Element c) => Collection c where
  - null :: c -> Bool
  - length :: c -> CountOf (Element c)
  - elem :: (Eq a, a ~ Element c) => Element c -> c -> Bool
  - notElem :: (Eq a, a ~ Element c) => Element c -> c -> Bool
  - maximum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c
  - minimum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c
  - any :: (Element c -> Bool) -> c -> Bool
  - all :: (Element c -> Bool) -> c -> Bool
- and :: (Collection col, Element col ~ Bool) => col -> Bool
- or :: (Collection col, Element col ~ Bool) => col -> Bool
- data NonEmpty a
- getNonEmpty :: NonEmpty a -> a
- nonEmpty :: Collection c => c -> Maybe (NonEmpty c)
- nonEmpty_ :: Collection c => c -> NonEmpty c
- nonEmptyFmap :: Functor f => (a -> b) -> NonEmpty (f a) -> NonEmpty (f b)
- class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where
  - take :: CountOf (Element c) -> c -> c
  - revTake :: CountOf (Element c) -> c -> c
  - drop :: CountOf (Element c) -> c -> c
  - revDrop :: CountOf (Element c) -> c -> c
  - splitAt :: CountOf (Element c) -> c -> (c, c)
  - revSplitAt :: CountOf (Element c) -> c -> (c, c)
  - splitOn :: (Element c -> Bool) -> c -> [c]
  - break :: (Element c -> Bool) -> c -> (c, c)
  - breakEnd :: (Element c -> Bool) -> c -> (c, c)
  - breakElem :: Element c -> c -> (c, c)
  - takeWhile :: (Element c -> Bool) -> c -> c
  - dropWhile :: (Element c -> Bool) -> c -> c
  - intersperse :: Element c -> c -> c
  - intercalate :: Element c -> c -> Element c
  - span :: (Element c -> Bool) -> c -> (c, c)
  - spanEnd :: (Element c -> Bool) -> c -> (c, c)
  - filter :: (Element c -> Bool) -> c -> c
  - partition :: (Element c -> Bool) -> c -> (c, c)
  - reverse :: c -> c
  - uncons :: c -> Maybe (Element c, c)
  - unsnoc :: c -> Maybe (c, Element c)
  - snoc :: c -> Element c -> c
  - cons :: Element c -> c -> c
  - find :: (Element c -> Bool) -> c -> Maybe (Element c)
  - sortBy :: (Element c -> Element c -> Ordering) -> c -> c
  - singleton :: Element c -> c
  - head :: NonEmpty c -> Element c
  - last :: NonEmpty c -> Element c
  - tail :: NonEmpty c -> c
  - init :: NonEmpty c -> c
  - replicate :: CountOf (Element c) -> Element c -> c
  - isPrefixOf :: c -> c -> Bool
  - isSuffixOf :: c -> c -> Bool
  - isInfixOf :: c -> c -> Bool
  - stripPrefix :: c -> c -> Maybe c
  - stripSuffix :: c -> c -> Maybe c
- class MutableCollection (c :: Type -> Type) where
  - type MutableFreezed (c :: Type -> Type)
  - type MutableKey (c :: Type -> Type)
  - type MutableValue (c :: Type -> Type)
  - unsafeThaw :: PrimMonad prim => MutableFreezed c -> prim (c (PrimState prim))
  - unsafeFreeze :: PrimMonad prim => c (PrimState prim) -> prim (MutableFreezed c)
  - thaw :: PrimMonad prim => MutableFreezed c -> prim (c (PrimState prim))
  - freeze :: PrimMonad prim => c (PrimState prim) -> prim (MutableFreezed c)
  - mutNew :: PrimMonad prim => CountOf (MutableValue c) -> prim (c (PrimState prim))
  - mutUnsafeWrite :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> MutableValue c -> prim ()
  - mutWrite :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> MutableValue c -> prim ()
  - mutUnsafeRead :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> prim (MutableValue c)
  - mutRead :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> prim (MutableValue c)
- class IndexedCollection c where
  - (!) :: c -> Offset (Element c) -> Maybe (Element c)
  - findIndex :: (Element c -> Bool) -> c -> Maybe (Offset (Element c))
- class KeyedCollection c where
  - type Key c
  - type Value c
  - lookup :: Key c -> c -> Maybe (Value c)
- class Sequential col => Zippable col where
  - zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element col) -> a -> b -> col
  - zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element col) -> a -> b -> c -> col
  - zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element col) -> a -> b -> c -> d -> col
  - zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element col) -> a -> b -> c -> d -> e -> col
  - zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element col) -> a -> b -> c -> d -> e -> f -> col
  - zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element col) -> a -> b -> c -> d -> e -> f -> g -> col
- class Buildable col where
  - type Mutable col :: Type -> Type
  - type Step col
  - append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element col -> Builder col (Mutable col) (Step col) prim err ()
  - build :: PrimMonad prim => Int -> Builder col (Mutable col) (Step col) prim err () -> prim (Either err col)
- build_ :: (Buildable c, PrimMonad prim) => Int -> Builder c (Mutable c) (Step c) prim () () -> prim c
- newtype Builder collection (mutCollection :: Type -> Type) step (state :: Type -> Type) err a = Builder {
  - runBuilder :: State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a
  }
- data BuildingState collection (mutCollection :: Type -> Type) step state = BuildingState {
  - prevChunks :: [collection]
  - prevChunksSize :: !(CountOf step)
  - curChunk :: mutCollection state
  - chunkSize :: !(CountOf step)
  }
- class Copy a where
  - copy :: a -> a

# Documentation

class Zippable col => BoxedZippable col where #

Minimal complete definition

Nothing

Methods

zip :: (Sequential a, Sequential b, Element col ~ (Element a, Element b)) => a -> b -> col #

`zip` takes two collections and returns a collections of corresponding pairs. If one input collection is short, excess elements of the longer collection are discarded.

zip3 :: (Sequential a, Sequential b, Sequential c, Element col ~ (Element a, Element b, Element c)) => a -> b -> c -> col #

Like `zip`, but works with 3 collections.

zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element col ~ (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> col #

Like `zip`, but works with 4 collections.

zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element col ~ (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> col #

Like `zip`, but works with 5 collections.

zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> col #

Like `zip`, but works with 6 collections.

zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> col #

Like `zip`, but works with 7 collections.

unzip :: (Sequential a, Sequential b, Element col ~ (Element a, Element b)) => col -> (a, b) #

`unzip` transforms a collection of pairs into a collection of first components and a collection of second components.

unzip3 :: (Sequential a, Sequential b, Sequential c, Element col ~ (Element a, Element b, Element c)) => col -> (a, b, c) #

Like `unzip`, but works on a collection of 3-element tuples.

unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element col ~ (Element a, Element b, Element c, Element d)) => col -> (a, b, c, d) #

Like `unzip`, but works on a collection of 4-element tuples.

unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element col ~ (Element a, Element b, Element c, Element d, Element e)) => col -> (a, b, c, d, e) #

Like `unzip`, but works on a collection of 5-element tuples.

unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => col -> (a, b, c, d, e, f) #

Like `unzip`, but works on a collection of 6-element tuples.

unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element col ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => col -> (a, b, c, d, e, f, g) #

Like `unzip`, but works on a collection of 7-element tuples.

#### Instances

Instances details

BoxedZippable (Array ty) # |
Instance details Defined in Foundation.Collection.Zippable Methods zip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => a -> b -> Array ty # zip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => a -> b -> c -> Array ty # zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element (Array ty) ~ (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> Array ty # zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> Array ty # zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> Array ty # zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> Array ty # unzip :: (Sequential a, Sequential b, Element (Array ty) ~ (Element a, Element b)) => Array ty -> (a, b) # unzip3 :: (Sequential a, Sequential b, Sequential c, Element (Array ty) ~ (Element a, Element b, Element c)) => Array ty -> (a, b, c) # unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, Element (Array ty) ~ (Element a, Element b, Element c, Element d)) => Array ty -> (a, b, c, d) # unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e)) => Array ty -> (a, b, c, d, e) # unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f)) => Array ty -> (a, b, c, d, e, f) # unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element (Array ty) ~ (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => Array ty -> (a, b, c, d, e, f, g) #
BoxedZippable [a] # |
Instance details Defined in Foundation.Collection.Zippable Methods zip :: (Sequential a0, Sequential b, Element [a] ~ (Element a0, Element b)) => a0 -> b -> [a] # zip3 :: (Sequential a0, Sequential b, Sequential c, Element [a] ~ (Element a0, Element b, Element c)) => a0 -> b -> c -> [a] # zip4 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Element [a] ~ (Element a0, Element b, Element c, Element d)) => a0 -> b -> c -> d -> [a] # zip5 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e)) => a0 -> b -> c -> d -> e -> [a] # zip6 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e, Element f)) => a0 -> b -> c -> d -> e -> f -> [a] # zip7 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e, Element f, Element g)) => a0 -> b -> c -> d -> e -> f -> g -> [a] # unzip :: (Sequential a0, Sequential b, Element [a] ~ (Element a0, Element b)) => [a] -> (a0, b) # unzip3 :: (Sequential a0, Sequential b, Sequential c, Element [a] ~ (Element a0, Element b, Element c)) => [a] -> (a0, b, c) # unzip4 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Element [a] ~ (Element a0, Element b, Element c, Element d)) => [a] -> (a0, b, c, d) # unzip5 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e)) => [a] -> (a0, b, c, d, e) # unzip6 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e, Element f)) => [a] -> (a0, b, c, d, e, f) # unzip7 :: (Sequential a0, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, Element [a] ~ (Element a0, Element b, Element c, Element d, Element e, Element f, Element g)) => [a] -> (a0, b, c, d, e, f, g) #

type family Element container #

Element type of a collection

#### Instances

Instances details

type Element AsciiString # |
Instance details Defined in Foundation.Collection.Element type Element AsciiString = Char7
type Element String # |
Instance details Defined in Foundation.Collection.Element type Element String = Char
type Element Bitmap # |
Instance details Defined in Foundation.Array.Bitmap type Element Bitmap = Bool
type Element CSV # |
Instance details Defined in Foundation.Format.CSV.Types type Element CSV = Row
type Element Row # |
Instance details Defined in Foundation.Format.CSV.Types type Element Row = Field
type Element (Block ty) # |
Instance details Defined in Foundation.Collection.Element type Element (Block ty) = ty
type Element (Array ty) # |
Instance details Defined in Foundation.Collection.Element type Element (Array ty) = ty
type Element (NonEmpty a) # |
Instance details Defined in Foundation.Collection.Element type Element (NonEmpty a) = Element a
type Element (UArray ty) # |
Instance details Defined in Foundation.Collection.Element type Element (UArray ty) = ty
type Element (ChunkedUArray ty) # |
Instance details Defined in Foundation.Array.Chunked.Unboxed type Element (ChunkedUArray ty) = ty
type Element (DList a) # |
Instance details Defined in Foundation.List.DList type Element (DList a) = a
type Element [a] # |
Instance details Defined in Foundation.Collection.Element type Element [a] = a
type Element (BlockN n ty) # |
Instance details Defined in Foundation.Collection.Element type Element (BlockN n ty) = ty
type Element (ListN n a) # |
Instance details Defined in Foundation.Collection.Element type Element (ListN n a) = a

class InnerFunctor c where #

A monomorphic functor that maps the inner values to values of the same type

Minimal complete definition

Nothing

Methods

imap :: (Element c -> Element c) -> c -> c #

default imap :: forall (f :: Type -> Type) a. (Functor f, Element (f a) ~ a, f a ~ c) => (Element c -> Element c) -> c -> c #

#### Instances

Instances details

InnerFunctor String # |
Instance details Defined in Foundation.Collection.InnerFunctor Methods imap :: (Element String -> Element String) -> String -> String #
InnerFunctor Bitmap # |
Instance details Defined in Foundation.Array.Bitmap Methods imap :: (Element Bitmap -> Element Bitmap) -> Bitmap -> Bitmap #
InnerFunctor (Array ty) # |
Instance details Defined in Foundation.Collection.InnerFunctor Methods imap :: (Element (Array ty) -> Element (Array ty)) -> Array ty -> Array ty #
PrimType ty => InnerFunctor (UArray ty) # |
Instance details Defined in Foundation.Collection.InnerFunctor Methods imap :: (Element (UArray ty) -> Element (UArray ty)) -> UArray ty -> UArray ty #
InnerFunctor [a] # |
Instance details Defined in Foundation.Collection.InnerFunctor Methods imap :: (Element [a] -> Element [a]) -> [a] -> [a] #

class Foldable collection where #

Give the ability to fold a collection on itself

Minimal complete definition

foldl', foldr

Methods

foldl' :: (a -> Element collection -> a) -> a -> collection -> a #

Left-associative fold of a structure.

In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

    foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.

Note that Foundation only provides `foldl'`, a strict version of `foldl` because the lazy version is seldom useful.

Left-associative fold of a structure with strict application of the operator.

foldr :: (Element collection -> a -> a) -> a -> collection -> a #

Right-associative fold of a structure.

    foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

foldr' :: (Element collection -> a -> a) -> a -> collection -> a #

Right-associative fold of a structure, but with strict application of the operator.

#### Instances

Instances details

Foldable Bitmap # |
Instance details Defined in Foundation.Array.Bitmap Methods foldl' :: (a -> Element Bitmap -> a) -> a -> Bitmap -> a # foldr :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a # foldr' :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a #
PrimType ty => Foldable (Block ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a -> Element (Block ty) -> a) -> a -> Block ty -> a # foldr :: (Element (Block ty) -> a -> a) -> a -> Block ty -> a # foldr' :: (Element (Block ty) -> a -> a) -> a -> Block ty -> a #
Foldable (Array ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a -> Element (Array ty) -> a) -> a -> Array ty -> a # foldr :: (Element (Array ty) -> a -> a) -> a -> Array ty -> a # foldr' :: (Element (Array ty) -> a -> a) -> a -> Array ty -> a #
PrimType ty => Foldable (UArray ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a -> Element (UArray ty) -> a) -> a -> UArray ty -> a # foldr :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a # foldr' :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a #
PrimType ty => Foldable (ChunkedUArray ty) # |
Instance details Defined in Foundation.Array.Chunked.Unboxed Methods foldl' :: (a -> Element (ChunkedUArray ty) -> a) -> a -> ChunkedUArray ty -> a # foldr :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a # foldr' :: (Element (ChunkedUArray ty) -> a -> a) -> a -> ChunkedUArray ty -> a #
Foldable (DList a) # |
Instance details Defined in Foundation.List.DList Methods foldl' :: (a0 -> Element (DList a) -> a0) -> a0 -> DList a -> a0 # foldr :: (Element (DList a) -> a0 -> a0) -> a0 -> DList a -> a0 # foldr' :: (Element (DList a) -> a0 -> a0) -> a0 -> DList a -> a0 #
Foldable [a] # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a0 -> Element [a] -> a0) -> a0 -> [a] -> a0 # foldr :: (Element [a] -> a0 -> a0) -> a0 -> [a] -> a0 # foldr' :: (Element [a] -> a0 -> a0) -> a0 -> [a] -> a0 #
PrimType ty => Foldable (BlockN n ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a -> Element (BlockN n ty) -> a) -> a -> BlockN n ty -> a # foldr :: (Element (BlockN n ty) -> a -> a) -> a -> BlockN n ty -> a # foldr' :: (Element (BlockN n ty) -> a -> a) -> a -> BlockN n ty -> a #
Foldable (ListN n a) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl' :: (a0 -> Element (ListN n a) -> a0) -> a0 -> ListN n a -> a0 # foldr :: (Element (ListN n a) -> a0 -> a0) -> a0 -> ListN n a -> a0 # foldr' :: (Element (ListN n a) -> a0 -> a0) -> a0 -> ListN n a -> a0 #

class Foldable f => Fold1able f where #

Fold1's. Like folds, but they assume to operate on a NonEmpty collection.

Methods

foldl1' :: (Element f -> Element f -> Element f) -> NonEmpty f -> Element f #

Left associative strict fold.

foldr1 :: (Element f -> Element f -> Element f) -> NonEmpty f -> Element f #

Right associative lazy fold.

#### Instances

Instances details

PrimType ty => Fold1able (Block ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl1' :: (Element (Block ty) -> Element (Block ty) -> Element (Block ty)) -> NonEmpty (Block ty) -> Element (Block ty) # foldr1 :: (Element (Block ty) -> Element (Block ty) -> Element (Block ty)) -> NonEmpty (Block ty) -> Element (Block ty) #
Fold1able (Array ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl1' :: (Element (Array ty) -> Element (Array ty) -> Element (Array ty)) -> NonEmpty (Array ty) -> Element (Array ty) # foldr1 :: (Element (Array ty) -> Element (Array ty) -> Element (Array ty)) -> NonEmpty (Array ty) -> Element (Array ty) #
PrimType ty => Fold1able (UArray ty) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl1' :: (Element (UArray ty) -> Element (UArray ty) -> Element (UArray ty)) -> NonEmpty (UArray ty) -> Element (UArray ty) # foldr1 :: (Element (UArray ty) -> Element (UArray ty) -> Element (UArray ty)) -> NonEmpty (UArray ty) -> Element (UArray ty) #
Fold1able [a] # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl1' :: (Element [a] -> Element [a] -> Element [a]) -> NonEmpty [a] -> Element [a] # foldr1 :: (Element [a] -> Element [a] -> Element [a]) -> NonEmpty [a] -> Element [a] #
1 <= n => Fold1able (ListN n a) # |
Instance details Defined in Foundation.Collection.Foldable Methods foldl1' :: (Element (ListN n a) -> Element (ListN n a) -> Element (ListN n a)) -> NonEmpty (ListN n a) -> Element (ListN n a) # foldr1 :: (Element (ListN n a) -> Element (ListN n a) -> Element (ListN n a)) -> NonEmpty (ListN n a) -> Element (ListN n a) #

class Functor collection => Mappable (collection :: Type -> Type) where #

Functors representing data structures that can be traversed from left to right.

Mostly like base's `Traversable` but applied to collections only.

Minimal complete definition

traverse | sequenceA

Methods

traverse :: Applicative f => (a -> f b) -> collection a -> f (collection b) #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see `traverse_`.

sequenceA :: Applicative f => collection (f a) -> f (collection a) #

Evaluate each actions of the given collections, from left to right, and collect the results. For a version that ignores the results, see `sequenceA_`

mapM :: (Applicative m, Monad m) => (a -> m b) -> collection a -> m (collection b) #

Map each element of the collection to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see `mapM_`.

sequence :: (Applicative m, Monad m) => collection (m a) -> m (collection a) #

Evaluate each actions of the given collections, from left to right, and collect the results. For a version that ignores the results, see `sequence_`

#### Instances

Instances details

Mappable Array # |
Instance details Defined in Foundation.Collection.Mappable Methods traverse :: Applicative f => (a -> f b) -> Array a -> f (Array b) # sequenceA :: Applicative f => Array (f a) -> f (Array a) # mapM :: (Applicative m, Monad m) => (a -> m b) -> Array a -> m (Array b) # sequence :: (Applicative m, Monad m) => Array (m a) -> m (Array a) #
Mappable [] # |
Instance details Defined in Foundation.Collection.Mappable Methods traverse :: Applicative f => (a -> f b) -> [a] -> f [b] # sequenceA :: Applicative f => [f a] -> f [a] # mapM :: (Applicative m, Monad m) => (a -> m b) -> [a] -> m [b] # sequence :: (Applicative m, Monad m) => [m a] -> m [a] #

traverse_ :: (Mappable col, Applicative f) => (a -> f b) -> col a -> f () #

Map each element of a collection to an action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `traverse`

mapM_ :: (Mappable col, Applicative m, Monad m) => (a -> m b) -> col a -> m () #

Evaluate each action in the collection from left to right, and ignore the results. For a version that doesn't ignore the results see `sequenceA`. sequenceA_ :: (Mappable col, Applicative f) => col (f a) -> f () sequenceA_ col = sequenceA col *> pure ()

Map each element of a collection to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `mapM`.

forM :: (Mappable col, Applicative m, Monad m) => col a -> (a -> m b) -> m (col b) #

`forM` is `mapM` with its arguments flipped. For a version that ignores the results see `forM_`.

forM_ :: (Mappable col, Applicative m, Monad m) => col a -> (a -> m b) -> m () #

`forM_` is `mapM_` with its arguments flipped. For a version that doesn't ignore the results see `forM`.

class (IsList c, Item c ~ Element c) => Collection c where #

A set of methods for ordered colection

Minimal complete definition

null, length, (elem | notElem), minimum, maximum, all, any

Methods

null :: c -> Bool #

Check if a collection is empty

length :: c -> CountOf (Element c) #

Length of a collection (number of Element c)

elem :: (Eq a, a ~ Element c) => Element c -> c -> Bool #

Check if a collection contains a specific element

This is the inverse of `notElem`.

notElem :: (Eq a, a ~ Element c) => Element c -> c -> Bool #

Check if a collection does *not* contain a specific element

This is the inverse of `elem`.

maximum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c #

Get the maximum element of a collection

minimum :: (Ord a, a ~ Element c) => NonEmpty c -> Element c #

Get the minimum element of a collection

any :: (Element c -> Bool) -> c -> Bool #

Determine is any elements of the collection satisfy the predicate

all :: (Element c -> Bool) -> c -> Bool #

Determine is all elements of the collection satisfy the predicate

#### Instances

Instances details

Collection AsciiString # |
Instance details Defined in Foundation.Collection.Collection Methods null :: AsciiString -> Bool # length :: AsciiString -> CountOf (Element AsciiString) # elem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool # notElem :: (Eq a, a ~ Element AsciiString) => Element AsciiString -> AsciiString -> Bool # maximum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString # minimum :: (Ord a, a ~ Element AsciiString) => NonEmpty AsciiString -> Element AsciiString # any :: (Element AsciiString -> Bool) -> AsciiString -> Bool # all :: (Element AsciiString -> Bool) -> AsciiString -> Bool #
Collection String # |
Instance details Defined in Foundation.Collection.Collection Methods null :: String -> Bool # length :: String -> CountOf (Element String) # elem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # notElem :: (Eq a, a ~ Element String) => Element String -> String -> Bool # maximum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # minimum :: (Ord a, a ~ Element String) => NonEmpty String -> Element String # any :: (Element String -> Bool) -> String -> Bool # all :: (Element String -> Bool) -> String -> Bool #
Collection Bitmap # |
Instance details Defined in Foundation.Array.Bitmap Methods null :: Bitmap -> Bool # length :: Bitmap -> CountOf (Element Bitmap) # elem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool # notElem :: (Eq a, a ~ Element Bitmap) => Element Bitmap -> Bitmap -> Bool # maximum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap # minimum :: (Ord a, a ~ Element Bitmap) => NonEmpty Bitmap -> Element Bitmap # any :: (Element Bitmap -> Bool) -> Bitmap -> Bool # all :: (Element Bitmap -> Bool) -> Bitmap -> Bool #
Collection CSV # |
Instance details Defined in Foundation.Format.CSV.Types Methods null :: CSV -> Bool # length :: CSV -> CountOf (Element CSV) # elem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool # notElem :: (Eq a, a ~ Element CSV) => Element CSV -> CSV -> Bool # maximum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV # minimum :: (Ord a, a ~ Element CSV) => NonEmpty CSV -> Element CSV # any :: (Element CSV -> Bool) -> CSV -> Bool # all :: (Element CSV -> Bool) -> CSV -> Bool #
Collection Row # |
Instance details Defined in Foundation.Format.CSV.Types Methods null :: Row -> Bool # length :: Row -> CountOf (Element Row) # elem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool # notElem :: (Eq a, a ~ Element Row) => Element Row -> Row -> Bool # maximum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row # minimum :: (Ord a, a ~ Element Row) => NonEmpty Row -> Element Row # any :: (Element Row -> Bool) -> Row -> Bool # all :: (Element Row -> Bool) -> Row -> Bool #
PrimType ty => Collection (Block ty) # |
Instance details Defined in Foundation.Collection.Collection Methods null :: Block ty -> Bool # length :: Block ty -> CountOf (Element (Block ty)) # elem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool # notElem :: (Eq a, a ~ Element (Block ty)) => Element (Block ty) -> Block ty -> Bool # maximum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) # minimum :: (Ord a, a ~ Element (Block ty)) => NonEmpty (Block ty) -> Element (Block ty) # any :: (Element (Block ty) -> Bool) -> Block ty -> Bool # all :: (Element (Block ty) -> Bool) -> Block ty -> Bool #
Collection (Array ty) # |
Instance details Defined in Foundation.Collection.Collection Methods null :: Array ty -> Bool # length :: Array ty -> CountOf (Element (Array ty)) # elem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # notElem :: (Eq a, a ~ Element (Array ty)) => Element (Array ty) -> Array ty -> Bool # maximum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # minimum :: (Ord a, a ~ Element (Array ty)) => NonEmpty (Array ty) -> Element (Array ty) # any :: (Element (Array ty) -> Bool) -> Array ty -> Bool # all :: (Element (Array ty) -> Bool) -> Array ty -> Bool #
Collection c => Collection (NonEmpty c) # |
Instance details Defined in Foundation.Collection.Collection Methods null :: NonEmpty c -> Bool # length :: NonEmpty c -> CountOf (Element (NonEmpty c)) # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool #
PrimType ty => Collection (UArray ty) # |
Instance details Defined in Foundation.Collection.Collection Methods null :: UArray ty -> Bool # length :: UArray ty -> CountOf (Element (UArray ty)) # elem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # notElem :: (Eq a, a ~ Element (UArray ty)) => Element (UArray ty) -> UArray ty -> Bool # maximum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # minimum :: (Ord a, a ~ Element (UArray ty)) => NonEmpty (UArray ty) -> Element (UArray ty) # any :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool # all :: (Element (UArray ty) -> Bool) -> UArray ty -> Bool #
PrimType ty => Collection (ChunkedUArray ty) # |
Instance details Defined in Foundation.Array.Chunked.Unboxed Methods null :: ChunkedUArray ty -> Bool # length :: ChunkedUArray ty -> CountOf (Element (ChunkedUArray ty)) # elem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # notElem :: (Eq a, a ~ Element (ChunkedUArray ty)) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # maximum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # minimum :: (Ord a, a ~ Element (ChunkedUArray ty)) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # any :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool # all :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Bool #
Collection (DList a) # |
Instance details Defined in Foundation.List.DList Methods null :: DList a -> Bool # length :: DList a -> CountOf (Element (DList a)) # elem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool # notElem :: (Eq a0, a0 ~ Element (DList a)) => Element (DList a) -> DList a -> Bool # maximum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) # minimum :: (Ord a0, a0 ~ Element (DList a)) => NonEmpty (DList a) -> Element (DList a) # any :: (Element (DList a) -> Bool) -> DList a -> Bool # all :: (Element (DList a) -> Bool) -> DList a -> Bool #
Collection [a] # |
Instance details Defined in Foundation.Collection.Collection Methods null :: [a] -> Bool # length :: [a] -> CountOf (Element [a]) # elem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool # notElem :: (Eq a0, a0 ~ Element [a]) => Element [a] -> [a] -> Bool # maximum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] # minimum :: (Ord a0, a0 ~ Element [a]) => NonEmpty [a] -> Element [a] # any :: (Element [a] -> Bool) -> [a] -> Bool # all :: (Element [a] -> Bool) -> [a] -> Bool #

and :: (Collection col, Element col ~ Bool) => col -> Bool #

Return True if all the elements in the collection are True

or :: (Collection col, Element col ~ Bool) => col -> Bool #

Return True if at least one element in the collection is True

data NonEmpty a #

NonEmpty property for any Collection

#### Instances

Instances details

Collection c => Collection (NonEmpty c) # |
Instance details Defined in Foundation.Collection.Collection Methods null :: NonEmpty c -> Bool # length :: NonEmpty c -> CountOf (Element (NonEmpty c)) # elem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # notElem :: (Eq a, a ~ Element (NonEmpty c)) => Element (NonEmpty c) -> NonEmpty c -> Bool # maximum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # minimum :: (Ord a, a ~ Element (NonEmpty c)) => NonEmpty (NonEmpty c) -> Element (NonEmpty c) # any :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool # all :: (Element (NonEmpty c) -> Bool) -> NonEmpty c -> Bool #
IsList c => IsList (NonEmpty c) |
Instance details Defined in Basement.NonEmpty Associated Types
type Item (NonEmpty c) |
Instance details Defined in Basement.NonEmpty type Item (NonEmpty c) = Item c
Methods fromList :: [Item (NonEmpty c)] -> NonEmpty c # fromListN :: Int -> [Item (NonEmpty c)] -> NonEmpty c # toList :: NonEmpty c -> [Item (NonEmpty c)] #
Show a => Show (NonEmpty a) |
Instance details Defined in Basement.NonEmpty Methods showsPrec :: Int -> NonEmpty a -> ShowS # show :: NonEmpty a -> String # showList :: [NonEmpty a] -> ShowS #
Eq a => Eq (NonEmpty a) |
Instance details Defined in Basement.NonEmpty Methods (==) :: NonEmpty a -> NonEmpty a -> Bool # (/=) :: NonEmpty a -> NonEmpty a -> Bool #
type Element (NonEmpty a) # |
Instance details Defined in Foundation.Collection.Element type Element (NonEmpty a) = Element a
type Item (NonEmpty c) |
Instance details Defined in Basement.NonEmpty type Item (NonEmpty c) = Item c

getNonEmpty :: NonEmpty a -> a #

nonEmpty :: Collection c => c -> Maybe (NonEmpty c) #

Smart constructor to create a NonEmpty collection

If the collection is empty, then Nothing is returned Otherwise, the collection is wrapped in the NonEmpty property

nonEmpty_ :: Collection c => c -> NonEmpty c #

same as `nonEmpty`, but assume that the collection is non empty, and return an asynchronous error if it is.

nonEmptyFmap :: Functor f => (a -> b) -> NonEmpty (f a) -> NonEmpty (f b) #

class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where #

A set of methods for ordered colection

Minimal complete definition

(take, drop | splitAt), (revTake, revDrop | revSplitAt), splitOn, (break | span), (breakEnd | spanEnd), intersperse, filter, reverse, uncons, unsnoc, snoc, cons, find, sortBy, singleton, replicate

Methods

take :: CountOf (Element c) -> c -> c #

Take the first @n elements of a collection

revTake :: CountOf (Element c) -> c -> c #

Take the last @n elements of a collection

drop :: CountOf (Element c) -> c -> c #

Drop the first @n elements of a collection

revDrop :: CountOf (Element c) -> c -> c #

Drop the last @n elements of a collection

splitAt :: CountOf (Element c) -> c -> (c, c) #

Split the collection at the @n'th elements

revSplitAt :: CountOf (Element c) -> c -> (c, c) #

Split the collection at the @n'th elements from the end

splitOn :: (Element c -> Bool) -> c -> [c] #

Split on a specific elements returning a list of colletion

break :: (Element c -> Bool) -> c -> (c, c) #

Split a collection when the predicate return true

breakEnd :: (Element c -> Bool) -> c -> (c, c) #

Split a collection when the predicate return true starting from the end of the collection

breakElem :: Element c -> c -> (c, c) #

Split a collection at the given element

takeWhile :: (Element c -> Bool) -> c -> c #

Return the longest prefix in the collection that satisfy the predicate

dropWhile :: (Element c -> Bool) -> c -> c #

Return the longest prefix in the collection that satisfy the predicate

intersperse :: Element c -> c -> c #

The `intersperse` function takes an element and a list and `intersperses' that element between the elements of the list. For example,

    intersperse ',' "abcde" == "a,b,c,d,e"

intercalate :: Element c -> c -> Element c #

`intercalate` `xs xss` is equivalent to `(`mconcat` (`intersperse` xs xss))`. It inserts the list `xs` in between the lists in `xss` and concatenates the result.

span :: (Element c -> Bool) -> c -> (c, c) #

Split a collection while the predicate return true

spanEnd :: (Element c -> Bool) -> c -> (c, c) #

Split a collection while the predicate return true starting from the end of the collection

filter :: (Element c -> Bool) -> c -> c #

Filter all the elements that satisfy the predicate

partition :: (Element c -> Bool) -> c -> (c, c) #

Partition the elements that satisfy the predicate and those that don't

reverse :: c -> c #

Reverse a collection

uncons :: c -> Maybe (Element c, c) #

Decompose a collection into its first element and the remaining collection. If the collection is empty, returns Nothing.

unsnoc :: c -> Maybe (c, Element c) #

Decompose a collection into a collection without its last element, and the last element If the collection is empty, returns Nothing.

snoc :: c -> Element c -> c #

Prepend an element to an ordered collection

cons :: Element c -> c -> c #

Append an element to an ordered collection

find :: (Element c -> Bool) -> c -> Maybe (Element c) #

Find an element in an ordered collection

sortBy :: (Element c -> Element c -> Ordering) -> c -> c #

Sort an ordered collection using the specified order function

singleton :: Element c -> c #

Create a collection with a single element

head :: NonEmpty c -> Element c #

get the first element of a non-empty collection

last :: NonEmpty c -> Element c #

get the last element of a non-empty collection

tail :: NonEmpty c -> c #

Extract the elements after the first element of a non-empty collection.

init :: NonEmpty c -> c #

Extract the elements before the last element of a non-empty collection.

replicate :: CountOf (Element c) -> Element c -> c #

Create a collection where the element in parameter is repeated N time

isPrefixOf :: c -> c -> Bool #

Takes two collections and returns True iff the first collection is a prefix of the second.

default isPrefixOf :: Eq c => c -> c -> Bool #

isSuffixOf :: c -> c -> Bool #

Takes two collections and returns True iff the first collection is a suffix of the second.

default isSuffixOf :: Eq c => c -> c -> Bool #

isInfixOf :: c -> c -> Bool #

Takes two collections and returns True iff the first collection is an infix of the second.

default isInfixOf :: Eq c => c -> c -> Bool #

stripPrefix :: c -> c -> Maybe c #

Try to strip a prefix from a collection

stripSuffix :: c -> c -> Maybe c #

Try to strip a suffix from a collection

#### Instances

Instances details

Sequential AsciiString # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # revTake :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # drop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # revDrop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString # splitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) # revSplitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) # splitOn :: (Element AsciiString -> Bool) -> AsciiString -> [AsciiString] # break :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # breakEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # breakElem :: Element AsciiString -> AsciiString -> (AsciiString, AsciiString) # takeWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # dropWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # intersperse :: Element AsciiString -> AsciiString -> AsciiString # intercalate :: Element AsciiString -> AsciiString -> Element AsciiString # span :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # spanEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # filter :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString # partition :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) # reverse :: AsciiString -> AsciiString # uncons :: AsciiString -> Maybe (Element AsciiString, AsciiString) # unsnoc :: AsciiString -> Maybe (AsciiString, Element AsciiString) # snoc :: AsciiString -> Element AsciiString -> AsciiString # cons :: Element AsciiString -> AsciiString -> AsciiString # find :: (Element AsciiString -> Bool) -> AsciiString -> Maybe (Element AsciiString) # sortBy :: (Element AsciiString -> Element AsciiString -> Ordering) -> AsciiString -> AsciiString # singleton :: Element AsciiString -> AsciiString # head :: NonEmpty AsciiString -> Element AsciiString # last :: NonEmpty AsciiString -> Element AsciiString # tail :: NonEmpty AsciiString -> AsciiString # init :: NonEmpty AsciiString -> AsciiString # replicate :: CountOf (Element AsciiString) -> Element AsciiString -> AsciiString # isPrefixOf :: AsciiString -> AsciiString -> Bool # isSuffixOf :: AsciiString -> AsciiString -> Bool # isInfixOf :: AsciiString -> AsciiString -> Bool # stripPrefix :: AsciiString -> AsciiString -> Maybe AsciiString # stripSuffix :: AsciiString -> AsciiString -> Maybe AsciiString #
Sequential String # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element String) -> String -> String # revTake :: CountOf (Element String) -> String -> String # drop :: CountOf (Element String) -> String -> String # revDrop :: CountOf (Element String) -> String -> String # splitAt :: CountOf (Element String) -> String -> (String, String) # revSplitAt :: CountOf (Element String) -> String -> (String, String) # splitOn :: (Element String -> Bool) -> String -> [String] # break :: (Element String -> Bool) -> String -> (String, String) # breakEnd :: (Element String -> Bool) -> String -> (String, String) # breakElem :: Element String -> String -> (String, String) # takeWhile :: (Element String -> Bool) -> String -> String # dropWhile :: (Element String -> Bool) -> String -> String # intersperse :: Element String -> String -> String # intercalate :: Element String -> String -> Element String # span :: (Element String -> Bool) -> String -> (String, String) # spanEnd :: (Element String -> Bool) -> String -> (String, String) # filter :: (Element String -> Bool) -> String -> String # partition :: (Element String -> Bool) -> String -> (String, String) # reverse :: String -> String # uncons :: String -> Maybe (Element String, String) # unsnoc :: String -> Maybe (String, Element String) # snoc :: String -> Element String -> String # cons :: Element String -> String -> String # find :: (Element String -> Bool) -> String -> Maybe (Element String) # sortBy :: (Element String -> Element String -> Ordering) -> String -> String # singleton :: Element String -> String # head :: NonEmpty String -> Element String # last :: NonEmpty String -> Element String # tail :: NonEmpty String -> String # init :: NonEmpty String -> String # replicate :: CountOf (Element String) -> Element String -> String # isPrefixOf :: String -> String -> Bool # isSuffixOf :: String -> String -> Bool # isInfixOf :: String -> String -> Bool # stripPrefix :: String -> String -> Maybe String # stripSuffix :: String -> String -> Maybe String #
Sequential Bitmap # |
Instance details Defined in Foundation.Array.Bitmap Methods take :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # revTake :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # drop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # revDrop :: CountOf (Element Bitmap) -> Bitmap -> Bitmap # splitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) # revSplitAt :: CountOf (Element Bitmap) -> Bitmap -> (Bitmap, Bitmap) # splitOn :: (Element Bitmap -> Bool) -> Bitmap -> [Bitmap] # break :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # breakEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # breakElem :: Element Bitmap -> Bitmap -> (Bitmap, Bitmap) # takeWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # dropWhile :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # intersperse :: Element Bitmap -> Bitmap -> Bitmap # intercalate :: Element Bitmap -> Bitmap -> Element Bitmap # span :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # spanEnd :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # filter :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # partition :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # reverse :: Bitmap -> Bitmap # uncons :: Bitmap -> Maybe (Element Bitmap, Bitmap) # unsnoc :: Bitmap -> Maybe (Bitmap, Element Bitmap) # snoc :: Bitmap -> Element Bitmap -> Bitmap # cons :: Element Bitmap -> Bitmap -> Bitmap # find :: (Element Bitmap -> Bool) -> Bitmap -> Maybe (Element Bitmap) # sortBy :: (Element Bitmap -> Element Bitmap -> Ordering) -> Bitmap -> Bitmap # singleton :: Element Bitmap -> Bitmap # head :: NonEmpty Bitmap -> Element Bitmap # last :: NonEmpty Bitmap -> Element Bitmap # tail :: NonEmpty Bitmap -> Bitmap # init :: NonEmpty Bitmap -> Bitmap # replicate :: CountOf (Element Bitmap) -> Element Bitmap -> Bitmap # isPrefixOf :: Bitmap -> Bitmap -> Bool # isSuffixOf :: Bitmap -> Bitmap -> Bool # isInfixOf :: Bitmap -> Bitmap -> Bool # stripPrefix :: Bitmap -> Bitmap -> Maybe Bitmap # stripSuffix :: Bitmap -> Bitmap -> Maybe Bitmap #
Sequential CSV # |
Instance details Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element CSV) -> CSV -> CSV # revTake :: CountOf (Element CSV) -> CSV -> CSV # drop :: CountOf (Element CSV) -> CSV -> CSV # revDrop :: CountOf (Element CSV) -> CSV -> CSV # splitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) # revSplitAt :: CountOf (Element CSV) -> CSV -> (CSV, CSV) # splitOn :: (Element CSV -> Bool) -> CSV -> [CSV] # break :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # breakEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # breakElem :: Element CSV -> CSV -> (CSV, CSV) # takeWhile :: (Element CSV -> Bool) -> CSV -> CSV # dropWhile :: (Element CSV -> Bool) -> CSV -> CSV # intersperse :: Element CSV -> CSV -> CSV # intercalate :: Element CSV -> CSV -> Element CSV # span :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # spanEnd :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # filter :: (Element CSV -> Bool) -> CSV -> CSV # partition :: (Element CSV -> Bool) -> CSV -> (CSV, CSV) # reverse :: CSV -> CSV # uncons :: CSV -> Maybe (Element CSV, CSV) # unsnoc :: CSV -> Maybe (CSV, Element CSV) # snoc :: CSV -> Element CSV -> CSV # cons :: Element CSV -> CSV -> CSV # find :: (Element CSV -> Bool) -> CSV -> Maybe (Element CSV) # sortBy :: (Element CSV -> Element CSV -> Ordering) -> CSV -> CSV # singleton :: Element CSV -> CSV # head :: NonEmpty CSV -> Element CSV # last :: NonEmpty CSV -> Element CSV # tail :: NonEmpty CSV -> CSV # init :: NonEmpty CSV -> CSV # replicate :: CountOf (Element CSV) -> Element CSV -> CSV # isPrefixOf :: CSV -> CSV -> Bool # isSuffixOf :: CSV -> CSV -> Bool # isInfixOf :: CSV -> CSV -> Bool # stripPrefix :: CSV -> CSV -> Maybe CSV # stripSuffix :: CSV -> CSV -> Maybe CSV #
Sequential Row # |
Instance details Defined in Foundation.Format.CSV.Types Methods take :: CountOf (Element Row) -> Row -> Row # revTake :: CountOf (Element Row) -> Row -> Row # drop :: CountOf (Element Row) -> Row -> Row # revDrop :: CountOf (Element Row) -> Row -> Row # splitAt :: CountOf (Element Row) -> Row -> (Row, Row) # revSplitAt :: CountOf (Element Row) -> Row -> (Row, Row) # splitOn :: (Element Row -> Bool) -> Row -> [Row] # break :: (Element Row -> Bool) -> Row -> (Row, Row) # breakEnd :: (Element Row -> Bool) -> Row -> (Row, Row) # breakElem :: Element Row -> Row -> (Row, Row) # takeWhile :: (Element Row -> Bool) -> Row -> Row # dropWhile :: (Element Row -> Bool) -> Row -> Row # intersperse :: Element Row -> Row -> Row # intercalate :: Element Row -> Row -> Element Row # span :: (Element Row -> Bool) -> Row -> (Row, Row) # spanEnd :: (Element Row -> Bool) -> Row -> (Row, Row) # filter :: (Element Row -> Bool) -> Row -> Row # partition :: (Element Row -> Bool) -> Row -> (Row, Row) # reverse :: Row -> Row # uncons :: Row -> Maybe (Element Row, Row) # unsnoc :: Row -> Maybe (Row, Element Row) # snoc :: Row -> Element Row -> Row # cons :: Element Row -> Row -> Row # find :: (Element Row -> Bool) -> Row -> Maybe (Element Row) # sortBy :: (Element Row -> Element Row -> Ordering) -> Row -> Row # singleton :: Element Row -> Row # head :: NonEmpty Row -> Element Row # last :: NonEmpty Row -> Element Row # tail :: NonEmpty Row -> Row # init :: NonEmpty Row -> Row # replicate :: CountOf (Element Row) -> Element Row -> Row # isPrefixOf :: Row -> Row -> Bool # isSuffixOf :: Row -> Row -> Bool # isInfixOf :: Row -> Row -> Bool # stripPrefix :: Row -> Row -> Maybe Row # stripSuffix :: Row -> Row -> Maybe Row #
PrimType ty => Sequential (Block ty) # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Block ty)) -> Block ty -> Block ty # revTake :: CountOf (Element (Block ty)) -> Block ty -> Block ty # drop :: CountOf (Element (Block ty)) -> Block ty -> Block ty # revDrop :: CountOf (Element (Block ty)) -> Block ty -> Block ty # splitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) # revSplitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) # splitOn :: (Element (Block ty) -> Bool) -> Block ty -> [Block ty] # break :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # breakEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # breakElem :: Element (Block ty) -> Block ty -> (Block ty, Block ty) # takeWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # dropWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # intersperse :: Element (Block ty) -> Block ty -> Block ty # intercalate :: Element (Block ty) -> Block ty -> Element (Block ty) # span :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # spanEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # filter :: (Element (Block ty) -> Bool) -> Block ty -> Block ty # partition :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) # reverse :: Block ty -> Block ty # uncons :: Block ty -> Maybe (Element (Block ty), Block ty) # unsnoc :: Block ty -> Maybe (Block ty, Element (Block ty)) # snoc :: Block ty -> Element (Block ty) -> Block ty # cons :: Element (Block ty) -> Block ty -> Block ty # find :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Element (Block ty)) # sortBy :: (Element (Block ty) -> Element (Block ty) -> Ordering) -> Block ty -> Block ty # singleton :: Element (Block ty) -> Block ty # head :: NonEmpty (Block ty) -> Element (Block ty) # last :: NonEmpty (Block ty) -> Element (Block ty) # tail :: NonEmpty (Block ty) -> Block ty # init :: NonEmpty (Block ty) -> Block ty # replicate :: CountOf (Element (Block ty)) -> Element (Block ty) -> Block ty # isPrefixOf :: Block ty -> Block ty -> Bool # isSuffixOf :: Block ty -> Block ty -> Bool # isInfixOf :: Block ty -> Block ty -> Bool # stripPrefix :: Block ty -> Block ty -> Maybe (Block ty) # stripSuffix :: Block ty -> Block ty -> Maybe (Block ty) #
Sequential (Array ty) # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revTake :: CountOf (Element (Array ty)) -> Array ty -> Array ty # drop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # revDrop :: CountOf (Element (Array ty)) -> Array ty -> Array ty # splitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # revSplitAt :: CountOf (Element (Array ty)) -> Array ty -> (Array ty, Array ty) # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) # takeWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # dropWhile :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # intersperse :: Element (Array ty) -> Array ty -> Array ty # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # spanEnd :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # reverse :: Array ty -> Array ty # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) # snoc :: Array ty -> Element (Array ty) -> Array ty # cons :: Element (Array ty) -> Array ty -> Array ty # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty # singleton :: Element (Array ty) -> Array ty # head :: NonEmpty (Array ty) -> Element (Array ty) # last :: NonEmpty (Array ty) -> Element (Array ty) # tail :: NonEmpty (Array ty) -> Array ty # init :: NonEmpty (Array ty) -> Array ty # replicate :: CountOf (Element (Array ty)) -> Element (Array ty) -> Array ty # isPrefixOf :: Array ty -> Array ty -> Bool # isSuffixOf :: Array ty -> Array ty -> Bool # isInfixOf :: Array ty -> Array ty -> Bool # stripPrefix :: Array ty -> Array ty -> Maybe (Array ty) # stripSuffix :: Array ty -> Array ty -> Maybe (Array ty) #
PrimType ty => Sequential (UArray ty) # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revTake :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # drop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # revDrop :: CountOf (Element (UArray ty)) -> UArray ty -> UArray ty # splitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # revSplitAt :: CountOf (Element (UArray ty)) -> UArray ty -> (UArray ty, UArray ty) # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) # takeWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # dropWhile :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # spanEnd :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # reverse :: UArray ty -> UArray ty # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) # snoc :: UArray ty -> Element (UArray ty) -> UArray ty # cons :: Element (UArray ty) -> UArray ty -> UArray ty # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty # singleton :: Element (UArray ty) -> UArray ty # head :: NonEmpty (UArray ty) -> Element (UArray ty) # last :: NonEmpty (UArray ty) -> Element (UArray ty) # tail :: NonEmpty (UArray ty) -> UArray ty # init :: NonEmpty (UArray ty) -> UArray ty # replicate :: CountOf (Element (UArray ty)) -> Element (UArray ty) -> UArray ty # isPrefixOf :: UArray ty -> UArray ty -> Bool # isSuffixOf :: UArray ty -> UArray ty -> Bool # isInfixOf :: UArray ty -> UArray ty -> Bool # stripPrefix :: UArray ty -> UArray ty -> Maybe (UArray ty) # stripSuffix :: UArray ty -> UArray ty -> Maybe (UArray ty) #
PrimType ty => Sequential (ChunkedUArray ty) # |
Instance details Defined in Foundation.Array.Chunked.Unboxed Methods take :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # revTake :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # drop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # revDrop :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> ChunkedUArray ty # splitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # revSplitAt :: CountOf (Element (ChunkedUArray ty)) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # splitOn :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> [ChunkedUArray ty] # break :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # breakEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # breakElem :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # takeWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # dropWhile :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # intersperse :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # intercalate :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> Element (ChunkedUArray ty) # span :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # spanEnd :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # filter :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # partition :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # reverse :: ChunkedUArray ty -> ChunkedUArray ty # uncons :: ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty), ChunkedUArray ty) # unsnoc :: ChunkedUArray ty -> Maybe (ChunkedUArray ty, Element (ChunkedUArray ty)) # snoc :: ChunkedUArray ty -> Element (ChunkedUArray ty) -> ChunkedUArray ty # cons :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # find :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty)) # sortBy :: (Element (ChunkedUArray ty) -> Element (ChunkedUArray ty) -> Ordering) -> ChunkedUArray ty -> ChunkedUArray ty # singleton :: Element (ChunkedUArray ty) -> ChunkedUArray ty # head :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # last :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # tail :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # init :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # replicate :: CountOf (Element (ChunkedUArray ty)) -> Element (ChunkedUArray ty) -> ChunkedUArray ty # isPrefixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # isSuffixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # isInfixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # stripPrefix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) # stripSuffix :: ChunkedUArray ty -> ChunkedUArray ty -> Maybe (ChunkedUArray ty) #
Sequential (DList a) # |
Instance details Defined in Foundation.List.DList Methods take :: CountOf (Element (DList a)) -> DList a -> DList a # revTake :: CountOf (Element (DList a)) -> DList a -> DList a # drop :: CountOf (Element (DList a)) -> DList a -> DList a # revDrop :: CountOf (Element (DList a)) -> DList a -> DList a # splitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) # revSplitAt :: CountOf (Element (DList a)) -> DList a -> (DList a, DList a) # splitOn :: (Element (DList a) -> Bool) -> DList a -> [DList a] # break :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # breakEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # breakElem :: Element (DList a) -> DList a -> (DList a, DList a) # takeWhile :: (Element (DList a) -> Bool) -> DList a -> DList a # dropWhile :: (Element (DList a) -> Bool) -> DList a -> DList a # intersperse :: Element (DList a) -> DList a -> DList a # intercalate :: Element (DList a) -> DList a -> Element (DList a) # span :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # spanEnd :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # filter :: (Element (DList a) -> Bool) -> DList a -> DList a # partition :: (Element (DList a) -> Bool) -> DList a -> (DList a, DList a) # reverse :: DList a -> DList a # uncons :: DList a -> Maybe (Element (DList a), DList a) # unsnoc :: DList a -> Maybe (DList a, Element (DList a)) # snoc :: DList a -> Element (DList a) -> DList a # cons :: Element (DList a) -> DList a -> DList a # find :: (Element (DList a) -> Bool) -> DList a -> Maybe (Element (DList a)) # sortBy :: (Element (DList a) -> Element (DList a) -> Ordering) -> DList a -> DList a # singleton :: Element (DList a) -> DList a # head :: NonEmpty (DList a) -> Element (DList a) # last :: NonEmpty (DList a) -> Element (DList a) # tail :: NonEmpty (DList a) -> DList a # init :: NonEmpty (DList a) -> DList a # replicate :: CountOf (Element (DList a)) -> Element (DList a) -> DList a # isPrefixOf :: DList a -> DList a -> Bool # isSuffixOf :: DList a -> DList a -> Bool # isInfixOf :: DList a -> DList a -> Bool # stripPrefix :: DList a -> DList a -> Maybe (DList a) # stripSuffix :: DList a -> DList a -> Maybe (DList a) #
Sequential [a] # |
Instance details Defined in Foundation.Collection.Sequential Methods take :: CountOf (Element [a]) -> [a] -> [a] # revTake :: CountOf (Element [a]) -> [a] -> [a] # drop :: CountOf (Element [a]) -> [a] -> [a] # revDrop :: CountOf (Element [a]) -> [a] -> [a] # splitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) # revSplitAt :: CountOf (Element [a]) -> [a] -> ([a], [a]) # splitOn :: (Element [a] -> Bool) -> [a] -> [[a]] # break :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # breakEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # breakElem :: Element [a] -> [a] -> ([a], [a]) # takeWhile :: (Element [a] -> Bool) -> [a] -> [a] # dropWhile :: (Element [a] -> Bool) -> [a] -> [a] # intersperse :: Element [a] -> [a] -> [a] # intercalate :: Element [a] -> [a] -> Element [a] # span :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # spanEnd :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # filter :: (Element [a] -> Bool) -> [a] -> [a] # partition :: (Element [a] -> Bool) -> [a] -> ([a], [a]) # reverse :: [a] -> [a] # uncons :: [a] -> Maybe (Element [a], [a]) # unsnoc :: [a] -> Maybe ([a], Element [a]) # snoc :: [a] -> Element [a] -> [a] # cons :: Element [a] -> [a] -> [a] # find :: (Element [a] -> Bool) -> [a] -> Maybe (Element [a]) # sortBy :: (Element [a] -> Element [a] -> Ordering) -> [a] -> [a] # singleton :: Element [a] -> [a] # head :: NonEmpty [a] -> Element [a] # last :: NonEmpty [a] -> Element [a] # tail :: NonEmpty [a] -> [a] # init :: NonEmpty [a] -> [a] # replicate :: CountOf (Element [a]) -> Element [a] -> [a] # isPrefixOf :: [a] -> [a] -> Bool # isSuffixOf :: [a] -> [a] -> Bool # isInfixOf :: [a] -> [a] -> Bool # stripPrefix :: [a] -> [a] -> Maybe [a] # stripSuffix :: [a] -> [a] -> Maybe [a] #

class MutableCollection (c :: Type -> Type) where #

Collection of things that can be made mutable, modified and then freezed into an MutableFreezed collection

Minimal complete definition

thaw, freeze, mutNew, mutWrite, mutRead, mutUnsafeWrite, mutUnsafeRead

Associated Types

type MutableFreezed (c :: Type -> Type) #

type MutableKey (c :: Type -> Type) #

type MutableValue (c :: Type -> Type) #

Methods

unsafeThaw :: PrimMonad prim => MutableFreezed c -> prim (c (PrimState prim)) #

unsafeFreeze :: PrimMonad prim => c (PrimState prim) -> prim (MutableFreezed c) #

thaw :: PrimMonad prim => MutableFreezed c -> prim (c (PrimState prim)) #

freeze :: PrimMonad prim => c (PrimState prim) -> prim (MutableFreezed c) #

mutNew :: PrimMonad prim => CountOf (MutableValue c) -> prim (c (PrimState prim)) #

mutUnsafeWrite :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> MutableValue c -> prim () #

mutWrite :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> MutableValue c -> prim () #

mutUnsafeRead :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> prim (MutableValue c) #

mutRead :: PrimMonad prim => c (PrimState prim) -> MutableKey c -> prim (MutableValue c) #

#### Instances

Instances details

MutableCollection MutableBitmap # |
Instance details Defined in Foundation.Array.Bitmap Associated Types
type MutableFreezed MutableBitmap |
Instance details Defined in Foundation.Array.Bitmap type MutableFreezed MutableBitmap = Bitmap
type MutableKey MutableBitmap |
Instance details Defined in Foundation.Array.Bitmap type MutableKey MutableBitmap = Offset Bool
type MutableValue MutableBitmap |
Instance details Defined in Foundation.Array.Bitmap type MutableValue MutableBitmap = Bool
Methods unsafeThaw :: PrimMonad prim => MutableFreezed MutableBitmap -> prim (MutableBitmap (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MutableBitmap (PrimState prim) -> prim (MutableFreezed MutableBitmap) # thaw :: PrimMonad prim => MutableFreezed MutableBitmap -> prim (MutableBitmap (PrimState prim)) # freeze :: PrimMonad prim => MutableBitmap (PrimState prim) -> prim (MutableFreezed MutableBitmap) # mutNew :: PrimMonad prim => CountOf (MutableValue MutableBitmap) -> prim (MutableBitmap (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> MutableValue MutableBitmap -> prim () # mutWrite :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> MutableValue MutableBitmap -> prim () # mutUnsafeRead :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> prim (MutableValue MutableBitmap) # mutRead :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> prim (MutableValue MutableBitmap) #
PrimType ty => MutableCollection (MutableBlock ty) # |
Instance details Defined in Foundation.Collection.Mutable Associated Types
type MutableFreezed (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableFreezed (MutableBlock ty) = Block ty
type MutableKey (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableKey (MutableBlock ty) = Offset ty
type MutableValue (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableValue (MutableBlock ty) = ty
Methods unsafeThaw :: PrimMonad prim => MutableFreezed (MutableBlock ty) -> prim (MutableBlock ty (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MutableBlock ty (PrimState prim) -> prim (MutableFreezed (MutableBlock ty)) # thaw :: PrimMonad prim => MutableFreezed (MutableBlock ty) -> prim (MutableBlock ty (PrimState prim)) # freeze :: PrimMonad prim => MutableBlock ty (PrimState prim) -> prim (MutableFreezed (MutableBlock ty)) # mutNew :: PrimMonad prim => CountOf (MutableValue (MutableBlock ty)) -> prim (MutableBlock ty (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> MutableValue (MutableBlock ty) -> prim () # mutWrite :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> MutableValue (MutableBlock ty) -> prim () # mutUnsafeRead :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> prim (MutableValue (MutableBlock ty)) # mutRead :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> prim (MutableValue (MutableBlock ty)) #
MutableCollection (MArray ty) # |
Instance details Defined in Foundation.Collection.Mutable Associated Types
type MutableFreezed (MArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableFreezed (MArray ty) = Array ty
type MutableKey (MArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableKey (MArray ty) = Offset ty
type MutableValue (MArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableValue (MArray ty) = ty
Methods unsafeThaw :: PrimMonad prim => MutableFreezed (MArray ty) -> prim (MArray ty (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (MutableFreezed (MArray ty)) # thaw :: PrimMonad prim => MutableFreezed (MArray ty) -> prim (MArray ty (PrimState prim)) # freeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (MutableFreezed (MArray ty)) # mutNew :: PrimMonad prim => CountOf (MutableValue (MArray ty)) -> prim (MArray ty (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () # mutWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () # mutUnsafeRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) # mutRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) #
PrimType ty => MutableCollection (MUArray ty) # |
Instance details Defined in Foundation.Collection.Mutable Associated Types
type MutableFreezed (MUArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableFreezed (MUArray ty) = UArray ty
type MutableKey (MUArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableKey (MUArray ty) = Offset ty
type MutableValue (MUArray ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableValue (MUArray ty) = ty
Methods unsafeThaw :: PrimMonad prim => MutableFreezed (MUArray ty) -> prim (MUArray ty (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (MutableFreezed (MUArray ty)) # thaw :: PrimMonad prim => MutableFreezed (MUArray ty) -> prim (MUArray ty (PrimState prim)) # freeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (MutableFreezed (MUArray ty)) # mutNew :: PrimMonad prim => CountOf (MutableValue (MUArray ty)) -> prim (MUArray ty (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () # mutWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () # mutUnsafeRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) # mutRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) #

class IndexedCollection c where #

Collection of elements that can indexed by int

Methods

(!) :: c -> Offset (Element c) -> Maybe (Element c) #

findIndex :: (Element c -> Bool) -> c -> Maybe (Offset (Element c)) #

#### Instances

Instances details

IndexedCollection String # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: String -> Offset (Element String) -> Maybe (Element String) # findIndex :: (Element String -> Bool) -> String -> Maybe (Offset (Element String)) #
IndexedCollection Bitmap # |
Instance details Defined in Foundation.Array.Bitmap Methods (!) :: Bitmap -> Offset (Element Bitmap) -> Maybe (Element Bitmap) # findIndex :: (Element Bitmap -> Bool) -> Bitmap -> Maybe (Offset (Element Bitmap)) #
IndexedCollection CSV # |
Instance details Defined in Foundation.Format.CSV.Types Methods (!) :: CSV -> Offset (Element CSV) -> Maybe (Element CSV) # findIndex :: (Element CSV -> Bool) -> CSV -> Maybe (Offset (Element CSV)) #
IndexedCollection Row # |
Instance details Defined in Foundation.Format.CSV.Types Methods (!) :: Row -> Offset (Element Row) -> Maybe (Element Row) # findIndex :: (Element Row -> Bool) -> Row -> Maybe (Offset (Element Row)) #
PrimType ty => IndexedCollection (Block ty) # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: Block ty -> Offset (Element (Block ty)) -> Maybe (Element (Block ty)) # findIndex :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Offset (Element (Block ty))) #
IndexedCollection (Array ty) # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: Array ty -> Offset (Element (Array ty)) -> Maybe (Element (Array ty)) # findIndex :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Offset (Element (Array ty))) #
PrimType ty => IndexedCollection (UArray ty) # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: UArray ty -> Offset (Element (UArray ty)) -> Maybe (Element (UArray ty)) # findIndex :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Offset (Element (UArray ty))) #
PrimType ty => IndexedCollection (ChunkedUArray ty) # |
Instance details Defined in Foundation.Array.Chunked.Unboxed Methods (!) :: ChunkedUArray ty -> Offset (Element (ChunkedUArray ty)) -> Maybe (Element (ChunkedUArray ty)) # findIndex :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe (Offset (Element (ChunkedUArray ty))) #
IndexedCollection [a] # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: [a] -> Offset (Element [a]) -> Maybe (Element [a]) # findIndex :: (Element [a] -> Bool) -> [a] -> Maybe (Offset (Element [a])) #
(NatWithinBound (CountOf ty) n, KnownNat n, PrimType ty) => IndexedCollection (BlockN n ty) # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: BlockN n ty -> Offset (Element (BlockN n ty)) -> Maybe (Element (BlockN n ty)) # findIndex :: (Element (BlockN n ty) -> Bool) -> BlockN n ty -> Maybe (Offset (Element (BlockN n ty))) #
(NatWithinBound Int n, KnownNat n) => IndexedCollection (ListN n a) # |
Instance details Defined in Foundation.Collection.Indexed Methods (!) :: ListN n a -> Offset (Element (ListN n a)) -> Maybe (Element (ListN n a)) # findIndex :: (Element (ListN n a) -> Bool) -> ListN n a -> Maybe (Offset (Element (ListN n a))) #

class KeyedCollection c where #

Collection of things that can be looked up by Key

Associated Types

type Key c #

type Value c #

Methods

lookup :: Key c -> c -> Maybe (Value c) #

#### Instances

Instances details

Eq k => KeyedCollection [(k, v)] # |
Instance details Defined in Foundation.Collection.Keyed Associated Types
type Key [(k, v)] |
Instance details Defined in Foundation.Collection.Keyed type Key [(k, v)] = k
type Value [(k, v)] |
Instance details Defined in Foundation.Collection.Keyed type Value [(k, v)] = v
Methods lookup :: Key [(k, v)] -> [(k, v)] -> Maybe (Value [(k, v)]) #

class Sequential col => Zippable col where #

Minimal complete definition

Nothing

Methods

zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element col) -> a -> b -> col #

`zipWith` generalises `zip` by zipping with the function given as the first argument, instead of a tupling function. For example, ``zipWith` (+)` is applied to two collections to produce the collection of corresponding sums.

zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element col) -> a -> b -> c -> col #

Like `zipWith`, but works with 3 collections.

zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element col) -> a -> b -> c -> d -> col #

Like `zipWith`, but works with 4 collections.

zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element col) -> a -> b -> c -> d -> e -> col #

Like `zipWith`, but works with 5 collections.

zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element col) -> a -> b -> c -> d -> e -> f -> col #

Like `zipWith`, but works with 6 collections.

zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element col) -> a -> b -> c -> d -> e -> f -> g -> col #

Like `zipWith`, but works with 7 collections.

#### Instances

Instances details

Zippable AsciiString # |
Instance details Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element AsciiString) -> a -> b -> AsciiString # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element AsciiString) -> a -> b -> c -> AsciiString # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element AsciiString) -> a -> b -> c -> d -> AsciiString # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element AsciiString) -> a -> b -> c -> d -> e -> AsciiString # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element AsciiString) -> a -> b -> c -> d -> e -> f -> AsciiString # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element AsciiString) -> a -> b -> c -> d -> e -> f -> g -> AsciiString #
Zippable String # |
Instance details Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element String) -> a -> b -> String # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element String) -> a -> b -> c -> String # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element String) -> a -> b -> c -> d -> String # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element String) -> a -> b -> c -> d -> e -> String # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element String) -> a -> b -> c -> d -> e -> f -> String # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element String) -> a -> b -> c -> d -> e -> f -> g -> String #
Zippable (Array ty) # |
Instance details Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (Array ty)) -> a -> b -> Array ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (Array ty)) -> a -> b -> c -> Array ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (Array ty)) -> a -> b -> c -> d -> Array ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (Array ty)) -> a -> b -> c -> d -> e -> Array ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> Array ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> g -> Array ty #
PrimType ty => Zippable (UArray ty) # |
Instance details Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (UArray ty)) -> a -> b -> UArray ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (UArray ty)) -> a -> b -> c -> UArray ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (UArray ty)) -> a -> b -> c -> d -> UArray ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (UArray ty)) -> a -> b -> c -> d -> e -> UArray ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> UArray ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> g -> UArray ty #
Zippable [c] # |
Instance details Defined in Foundation.Collection.Zippable Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element [c]) -> a -> b -> [c] # zipWith3 :: (Sequential a, Sequential b, Sequential c0) => (Element a -> Element b -> Element c0 -> Element [c]) -> a -> b -> c0 -> [c] # zipWith4 :: (Sequential a, Sequential b, Sequential c0, Sequential d) => (Element a -> Element b -> Element c0 -> Element d -> Element [c]) -> a -> b -> c0 -> d -> [c] # zipWith5 :: (Sequential a, Sequential b, Sequential c0, Sequential d, Sequential e) => (Element a -> Element b -> Element c0 -> Element d -> Element e -> Element [c]) -> a -> b -> c0 -> d -> e -> [c] # zipWith6 :: (Sequential a, Sequential b, Sequential c0, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c0 -> Element d -> Element e -> Element f -> Element [c]) -> a -> b -> c0 -> d -> e -> f -> [c] # zipWith7 :: (Sequential a, Sequential b, Sequential c0, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c0 -> Element d -> Element e -> Element f -> Element g -> Element [c]) -> a -> b -> c0 -> d -> e -> f -> g -> [c] #

class Buildable col where #

Collections that can be built chunk by chunk.

Use the `Monad` instance of `Builder` to chain `append` operations and feed it into `build`:

    >>> runST $ build 32 (append 'a' >> append 'b' >> append 'c') :: UArray Char
    "abc"

Associated Types

type Mutable col :: Type -> Type #

Mutable collection type used for incrementally writing chunks.

type Step col #

Unit of the smallest step possible in an `append` operation.

A UTF-8 character can have a size between 1 and 4 bytes, so this should be defined as 1 byte for collections of `Char`.

Methods

append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element col -> Builder col (Mutable col) (Step col) prim err () #

build #

Arguments

:: PrimMonad prim |
=> Int | CountOf of a chunk
-> Builder col (Mutable col) (Step col) prim err () |
-> prim (Either err col) |

#### Instances

Instances details

Buildable String # |
Instance details Defined in Foundation.Collection.Buildable Associated Types
type Mutable String |
Instance details Defined in Foundation.Collection.Buildable type Mutable String = MutableString
type Step String |
Instance details Defined in Foundation.Collection.Buildable type Step String = Word8
Methods append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element String -> Builder String (Mutable String) (Step String) prim err () # build :: PrimMonad prim => Int -> Builder String (Mutable String) (Step String) prim err () -> prim (Either err String) #
Buildable (Array ty) # |
Instance details Defined in Foundation.Collection.Buildable Associated Types
type Mutable (Array ty) |
Instance details Defined in Foundation.Collection.Buildable type Mutable (Array ty) = MArray ty
type Step (Array ty) |
Instance details Defined in Foundation.Collection.Buildable type Step (Array ty) = ty
Methods append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element (Array ty) -> Builder (Array ty) (Mutable (Array ty)) (Step (Array ty)) prim err () # build :: PrimMonad prim => Int -> Builder (Array ty) (Mutable (Array ty)) (Step (Array ty)) prim err () -> prim (Either err (Array ty)) #
PrimType ty => Buildable (UArray ty) # |
Instance details Defined in Foundation.Collection.Buildable Associated Types
type Mutable (UArray ty) |
Instance details Defined in Foundation.Collection.Buildable type Mutable (UArray ty) = MUArray ty
type Step (UArray ty) |
Instance details Defined in Foundation.Collection.Buildable type Step (UArray ty) = ty
Methods append :: forall (prim :: Type -> Type) err. PrimMonad prim => Element (UArray ty) -> Builder (UArray ty) (Mutable (UArray ty)) (Step (UArray ty)) prim err () # build :: PrimMonad prim => Int -> Builder (UArray ty) (Mutable (UArray ty)) (Step (UArray ty)) prim err () -> prim (Either err (UArray ty)) #

build_ #

Arguments

:: (Buildable c, PrimMonad prim) |
=> Int | CountOf of a chunk
-> Builder c (Mutable c) (Step c) prim () () |
-> prim c |

newtype Builder collection (mutCollection :: Type -> Type) step (state :: Type -> Type) err a #

Constructors

Builder |
Fields runBuilder :: State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a

#### Instances

Instances details

Monad state => MonadFailure (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder Associated Types
type Failure (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder type Failure (Builder collection mutCollection step state err) = err
Methods mFail :: Failure (Builder collection mutCollection step state err) -> Builder collection mutCollection step state err () #
Monad state => Applicative (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder Methods pure :: a -> Builder collection mutCollection step state err a # (<*>) :: Builder collection mutCollection step state err (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b # liftA2 :: (a -> b -> c) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err c # (*>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b # (<*) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a #
Monad state => Functor (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder Methods fmap :: (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b # (<$) :: a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a #
Monad state => Monad (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder Methods (>>=) :: Builder collection mutCollection step state err a -> (a -> Builder collection mutCollection step state err b) -> Builder collection mutCollection step state err b # (>>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b # return :: a -> Builder collection mutCollection step state err a #
type Failure (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder type Failure (Builder collection mutCollection step state err) = err

data BuildingState collection (mutCollection :: Type -> Type) step state #

The in-progress state of a building operation.

The previous buffers are in reverse order, and this contains the current buffer and the state of progress packing the elements inside.

Constructors

BuildingState |
Fields prevChunks :: [collection] prevChunksSize :: !(CountOf step) curChunk :: mutCollection state chunkSize :: !(CountOf step)

class Copy a where #

Methods

copy :: a -> a #

#### Instances

Instances details

Copy String # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: String -> String #
PrimType ty => Copy (Block ty) # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: Block ty -> Block ty #
Copy (Array ty) # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: Array ty -> Array ty #
PrimType ty => Copy (UArray ty) # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: UArray ty -> UArray ty #
Copy [ty] # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: [ty] -> [ty] #
(Countable ty n, PrimType ty, KnownNat n) => Copy (BlockN n ty) # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: BlockN n ty -> BlockN n ty #
Copy (ListN n ty) # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: ListN n ty -> ListN n ty #