Map each element of a List to a monadic action, evaluate these actions sequentially and ignore the results
Modulefoundation-0.0.30Haskell2010
Foundation.List.ListN
A Nat-sized list abstraction
Using this module is limited to GHC 7.10 and above.
- 1 type
- 50 values
- Packagefoundation-0.0.30
- Exports51
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceListN.hs
A Typed-level sized List equivalent to [a]
Instances12Eq, Ord, Show, Generic, NormalForm, Foldable, …
Eq a => Eq (ListN n a)Defined in basement-0.0.16 · Basement.Sized.ListOrd a => Ord (ListN n a)Defined in basement-0.0.16 · Basement.Sized.ListShow a => Show (ListN n a)Defined in basement-0.0.16 · Basement.Sized.ListGeneric (ListN n a)Defined in basement-0.0.16 · Basement.Sized.ListNormalForm a => NormalForm (ListN n a)Defined in basement-0.0.16 · Basement.Sized.ListFoldable (ListN n a)Defined in foundation-0.0.30 · Foundation.Collection.Foldable(Arbitrary a, KnownNat n, NatWithinBound Int n) => Arbitrary (ListN n a)Defined in foundation-0.0.30 · Foundation.Check.ArbitraryCopy (ListN n ty)Defined in foundation-0.0.30 · Foundation.Collection.CopyDefined in foundation-0.0.30 · Foundation.Collection.Foldable1
<= n => Fold1able (ListN n a)(NatWithinBound Int n, KnownNat n) => IndexedCollection (ListN n a)Defined in foundation-0.0.30 · Foundation.Collection.Indexedtype Rep (ListN n a) = D1 ('MetaDataDefined in basement-0.0.16 · Basement.Sized.List"ListN"
"Basement.Sized.List"
"basement-0.0.16-HSpAMwbNqIYE6yCkmfUTGp"
'True) (C1 ('MetaCons"ListN"
'PrefixI 'True) (S1 ('MetaSel ('Just"unListN"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))type Element (ListN n a) = aDefined in foundation-0.0.30 · Foundation.Collection.Element
performs a monadic action n times, gathering the results in a List of size n.
Check if a list contains the element a
Get the length of a list
Create a list of n elements where each element is the element in argument
Take m elements from the beggining of the list.
The number of elements need to be less or equal to the list in argument
Create an empty list of a
Fold all elements from left strictly
Decompose a list into its head and tail.
Decompose a list into its first elements and the last.
Evaluate each monadic action in the list sequentially, and ignore the results.
create a list of 1 element
append an element to the list
Reverse a list
Append 2 list together returning the new list
Get the i'the element
prepend an element to the list
Get the head element of a list
Fold all elements from left
Fold all elements from left strictly with a first element as the accumulator
Create a new list of size n, repeately calling f from 0 to n-1
Drop elements from a list keeping the m remaining elements
Fold all elements from right
Fold all elements from right assuming at least one element is in the list.
Map all elements in a list
Split a list into two, returning 2 lists
Map each element of a List to a monadic action, evaluate these actions sequentially and collect the results
Evaluate each monadic action in the list sequentially, and collect the results.
Get the list with the last element missing
Get the tail of a list
Unzip a list of tuple, to 2 List of the deconstructed tuples
Zip 3 lists of the same size
Zip 2 lists using a function
Zip 3 lists using a function
Get the maximum element of a list
Get the minimum element of a list
Zip 2 lists of the same size, returning a new list of the tuple of each elements
Get the i'th elements
This only works with TypeApplication:
indexStatic @1 (toListN_ [1,2,3] :: ListN 3 Int)Same as create but apply an offset
Map all elements in a list with an additional index
scanl is similar to foldl, but returns a list of successive
reduced values from the left
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]Try to create a ListN from a List, succeeding if the length is correct
Create a ListN from a List, expecting a given length
If this list contains more or less than the expected length of the resulting type, then an asynchronous error is raised. use toListN for a more friendly functions
Update the value in a list at a specific location
Zip 4 lists of the same size
Zip 5 lists of the same size
Zip 4 lists using a function
Zip 5 lists using a function