foundation-0.0.1: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

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

Documentation

class Zippable col => BoxedZippable col where Source #

Methods

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

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 Source #

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 Source #

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 Source #

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 Source #

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 Source #

Like zip, but works with 7 collections.

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

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) Source #

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) Source #

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) Source #

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) Source #

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) Source #

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

Instances

BoxedZippable [a] Source # 

Methods

zip :: (Sequential a, Sequential b, (* ~ Element [a]) (Element a, Element b)) => a -> b -> [a] Source #

zip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element [a]) (Element a, Element b, Element c)) => a -> b -> c -> [a] Source #

zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, (* ~ Element [a]) (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> [a] Source #

zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> [a] Source #

zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> [a] Source #

zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> [a] Source #

unzip :: (Sequential a, Sequential b, (* ~ Element [a]) (Element a, Element b)) => [a] -> (a, b) Source #

unzip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element [a]) (Element a, Element b, Element c)) => [a] -> (a, b, c) Source #

unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, (* ~ Element [a]) (Element a, Element b, Element c, Element d)) => [a] -> (a, b, c, d) Source #

unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e)) => [a] -> (a, b, c, d, e) Source #

unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e, Element f)) => [a] -> (a, b, c, d, e, f) Source #

unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, (* ~ Element [a]) (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => [a] -> (a, b, c, d, e, f, g) Source #

BoxedZippable (Array ty) Source # 

Methods

zip :: (Sequential a, Sequential b, (* ~ Element (Array ty)) (Element a, Element b)) => a -> b -> Array ty Source #

zip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element (Array ty)) (Element a, Element b, Element c)) => a -> b -> c -> Array ty Source #

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 Source #

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 Source #

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 Source #

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 Source #

unzip :: (Sequential a, Sequential b, (* ~ Element (Array ty)) (Element a, Element b)) => Array ty -> (a, b) Source #

unzip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element (Array ty)) (Element a, Element b, Element c)) => Array ty -> (a, b, c) Source #

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) Source #

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) Source #

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) Source #

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) Source #

type family Element container Source #

Element type of a collection

Instances

type Element Bitmap Source # 
type Element String Source # 
type Element [a] Source # 
type Element [a] = a
type Element (UArray ty) Source # 
type Element (UArray ty) = ty
type Element (Array ty) Source # 
type Element (Array ty) = ty

class InnerFunctor c where Source #

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

Methods

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

imap :: (Functor f, Element (f a) ~ a, f a ~ c) => (a -> a) -> f a -> f a Source #

Instances

InnerFunctor Bitmap Source # 
InnerFunctor String Source # 
InnerFunctor [a] Source # 

Methods

imap :: (Element [a] -> Element [a]) -> [a] -> [a] Source #

PrimType ty => InnerFunctor (UArray ty) Source # 

Methods

imap :: (Element (UArray ty) -> Element (UArray ty)) -> UArray ty -> UArray ty Source #

InnerFunctor (Array ty) Source # 

Methods

imap :: (Element (Array ty) -> Element (Array ty)) -> Array ty -> Array ty Source #

class Foldable collection where Source #

Give the ability to fold a collection on itself

Minimal complete definition

foldl, foldl', foldr

Methods

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

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.

Also note that if you want an efficient left-fold, you probably want to use foldl' instead of foldl. The reason for this is that latter does not force the "inner" results (e.g. z f x1 in the above example) before applying them to the operator (e.g. to (f x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.

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

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

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

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 Source #

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

Instances

Foldable Bitmap Source # 

Methods

foldl :: (a -> Element Bitmap -> a) -> a -> Bitmap -> a Source #

foldl' :: (a -> Element Bitmap -> a) -> a -> Bitmap -> a Source #

foldr :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a Source #

foldr' :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a Source #

Foldable [a] Source # 

Methods

foldl :: (a -> Element [a] -> a) -> a -> [a] -> a Source #

foldl' :: (a -> Element [a] -> a) -> a -> [a] -> a Source #

foldr :: (Element [a] -> a -> a) -> a -> [a] -> a Source #

foldr' :: (Element [a] -> a -> a) -> a -> [a] -> a Source #

PrimType ty => Foldable (UArray ty) Source # 

Methods

foldl :: (a -> Element (UArray ty) -> a) -> a -> UArray ty -> a Source #

foldl' :: (a -> Element (UArray ty) -> a) -> a -> UArray ty -> a Source #

foldr :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a Source #

foldr' :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a Source #

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

A set of methods for ordered colection

Methods

null :: c -> Bool Source #

Check if a collection is empty

take :: Int -> c -> c Source #

Take the first @n elements of a collection

revTake :: Int -> c -> c Source #

Take the last @n elements of a collection

drop :: Int -> c -> c Source #

Drop the first @n elements of a collection

revDrop :: Int -> c -> c Source #

Drop the last @n elements of a collection

splitAt :: Int -> c -> (c, c) Source #

Split the collection at the @n'th elements

revSplitAt :: Int -> c -> (c, c) Source #

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

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

Split on a specific elements returning a list of colletion

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

Split a collection when the predicate return true

breakElem :: Eq (Element c) => Element c -> c -> (c, c) Source #

Split a collection when the predicate return true

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

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 :: Monoid (Item c) => Element c -> c -> Element c Source #

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) Source #

Split a collection while the predicate return true

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

Filter all the elements that satisfy the predicate

reverse :: c -> c Source #

Reverse a collection

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

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

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

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 Source #

Prepend an element to an ordered collection

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

Append an element to an ordered collection

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

Find an element in an ordered collection

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

Sort an ordered collection using the specified order function

length :: c -> Int Source #

Length of a collection (number of Element c)

singleton :: Element c -> c Source #

Create a collection with a single element

Instances

Sequential Bitmap Source # 
Sequential String Source # 
Sequential [a] Source # 

Methods

null :: [a] -> Bool Source #

take :: Int -> [a] -> [a] Source #

revTake :: Int -> [a] -> [a] Source #

drop :: Int -> [a] -> [a] Source #

revDrop :: Int -> [a] -> [a] Source #

splitAt :: Int -> [a] -> ([a], [a]) Source #

revSplitAt :: Int -> [a] -> ([a], [a]) Source #

splitOn :: (Element [a] -> Bool) -> [a] -> [[a]] Source #

break :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source #

breakElem :: Element [a] -> [a] -> ([a], [a]) Source #

intersperse :: Element [a] -> [a] -> [a] Source #

intercalate :: Element [a] -> [a] -> Element [a] Source #

span :: (Element [a] -> Bool) -> [a] -> ([a], [a]) Source #

filter :: (Element [a] -> Bool) -> [a] -> [a] Source #

reverse :: [a] -> [a] Source #

uncons :: [a] -> Maybe (Element [a], [a]) Source #

unsnoc :: [a] -> Maybe ([a], Element [a]) Source #

snoc :: [a] -> Element [a] -> [a] Source #

cons :: Element [a] -> [a] -> [a] Source #

find :: (Element [a] -> Bool) -> [a] -> Maybe (Element [a]) Source #

sortBy :: (Element [a] -> Element [a] -> Ordering) -> [a] -> [a] Source #

length :: [a] -> Int Source #

singleton :: Element [a] -> [a] Source #

PrimType ty => Sequential (UArray ty) Source # 

Methods

null :: UArray ty -> Bool Source #

take :: Int -> UArray ty -> UArray ty Source #

revTake :: Int -> UArray ty -> UArray ty Source #

drop :: Int -> UArray ty -> UArray ty Source #

revDrop :: Int -> UArray ty -> UArray ty Source #

splitAt :: Int -> UArray ty -> (UArray ty, UArray ty) Source #

revSplitAt :: Int -> UArray ty -> (UArray ty, UArray ty) Source #

splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] Source #

break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source #

breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) Source #

intersperse :: Element (UArray ty) -> UArray ty -> UArray ty Source #

intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) Source #

span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) Source #

filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty Source #

reverse :: UArray ty -> UArray ty Source #

uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) Source #

unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) Source #

snoc :: UArray ty -> Element (UArray ty) -> UArray ty Source #

cons :: Element (UArray ty) -> UArray ty -> UArray ty Source #

find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) Source #

sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty Source #

length :: UArray ty -> Int Source #

singleton :: Element (UArray ty) -> UArray ty Source #

Sequential (Array ty) Source # 

Methods

null :: Array ty -> Bool Source #

take :: Int -> Array ty -> Array ty Source #

revTake :: Int -> Array ty -> Array ty Source #

drop :: Int -> Array ty -> Array ty Source #

revDrop :: Int -> Array ty -> Array ty Source #

splitAt :: Int -> Array ty -> (Array ty, Array ty) Source #

revSplitAt :: Int -> Array ty -> (Array ty, Array ty) Source #

splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] Source #

break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source #

breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) Source #

intersperse :: Element (Array ty) -> Array ty -> Array ty Source #

intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) Source #

span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) Source #

filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty Source #

reverse :: Array ty -> Array ty Source #

uncons :: Array ty -> Maybe (Element (Array ty), Array ty) Source #

unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) Source #

snoc :: Array ty -> Element (Array ty) -> Array ty Source #

cons :: Element (Array ty) -> Array ty -> Array ty Source #

find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) Source #

sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty Source #

length :: Array ty -> Int Source #

singleton :: Element (Array ty) -> Array ty Source #

class MutableCollection c where Source #

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

Minimal complete definition

thaw, freeze, mutWrite, mutRead, mutUnsafeWrite, mutUnsafeRead

Associated Types

type Collection c Source #

type MutableKey c Source #

type MutableValue c Source #

Methods

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

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

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

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

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

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

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

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

Instances

MutableCollection MutableBitmap Source # 
PrimType ty => MutableCollection (MUArray ty) Source # 

Associated Types

type Collection (MUArray ty :: * -> *) :: * Source #

type MutableKey (MUArray ty :: * -> *) :: * Source #

type MutableValue (MUArray ty :: * -> *) :: * Source #

Methods

unsafeThaw :: PrimMonad prim => Collection (MUArray ty) -> prim (MUArray ty (PrimState prim)) Source #

unsafeFreeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (Collection (MUArray ty)) Source #

thaw :: PrimMonad prim => Collection (MUArray ty) -> prim (MUArray ty (PrimState prim)) Source #

freeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (Collection (MUArray ty)) Source #

mutUnsafeWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () Source #

mutWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () Source #

mutUnsafeRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) Source #

mutRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) Source #

MutableCollection (MArray ty) Source # 

Associated Types

type Collection (MArray ty :: * -> *) :: * Source #

type MutableKey (MArray ty :: * -> *) :: * Source #

type MutableValue (MArray ty :: * -> *) :: * Source #

Methods

unsafeThaw :: PrimMonad prim => Collection (MArray ty) -> prim (MArray ty (PrimState prim)) Source #

unsafeFreeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (Collection (MArray ty)) Source #

thaw :: PrimMonad prim => Collection (MArray ty) -> prim (MArray ty (PrimState prim)) Source #

freeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (Collection (MArray ty)) Source #

mutUnsafeWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () Source #

mutWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () Source #

mutUnsafeRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) Source #

mutRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) Source #

class IndexedCollection c where Source #

Collection of elements that can indexed by int

Minimal complete definition

(!), findIndex

Methods

(!) :: c -> Int -> Maybe (Element c) Source #

findIndex :: (Element c -> Bool) -> c -> Maybe Int Source #

class KeyedCollection c where Source #

Collection of things that can be looked up by Key

Minimal complete definition

lookup

Associated Types

type Key c Source #

type Value c Source #

Methods

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

Instances

Eq k => KeyedCollection [(k, v)] Source # 

Associated Types

type Key [(k, v)] :: * Source #

type Value [(k, v)] :: * Source #

Methods

lookup :: Key [(k, v)] -> [(k, v)] -> Maybe (Value [(k, v)]) Source #

class Sequential col => Zippable col where Source #

Methods

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

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 Source #

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 Source #

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 Source #

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 Source #

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 Source #

Like zipWith, but works with 7 collections.

Instances

Zippable String Source # 

Methods

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

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

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

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 Source #

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 Source #

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 Source #

Zippable [c] Source # 

Methods

zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element [c]) -> a -> b -> [c] Source #

zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element [c]) -> a -> b -> c -> [c] Source #

zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element [c]) -> a -> b -> c -> d -> [c] Source #

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

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 [c]) -> a -> b -> c -> d -> e -> f -> [c] Source #

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 [c]) -> a -> b -> c -> d -> e -> f -> g -> [c] Source #

PrimType ty => Zippable (UArray ty) Source # 

Methods

zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (UArray ty)) -> a -> b -> UArray ty Source #

zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (UArray ty)) -> a -> b -> c -> UArray ty Source #

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 Source #

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 Source #

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 Source #

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 Source #

Zippable (Array ty) Source # 

Methods

zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (Array ty)) -> a -> b -> Array ty Source #

zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (Array ty)) -> a -> b -> c -> Array ty Source #

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 Source #

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 Source #

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 Source #

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 Source #