Skip to content
Cinch
← Data.List API referenceSAMPLE LISTING
cinch-base / 0.1.0Data/List.cinch

Declaration source.

This sample listing contains the declarations shown in the API reference. Package implementations will appear here when real package data is connected.

module Data.List where
3-- A finite sequence of values of the same type.
4data List a
5-- Nil :: List a
6-- Cons :: a -> List a -> List a
7
8-- Transform each element, retaining the order of the input.
9map :: forall a b. (a -> b) -> List a -> List b
11-- Fold a list from the right using a combining function and an initial value.
12foldr :: forall a b. (a -> b -> b) -> b -> List a -> b
14-- Count the elements in a finite list.
15length :: forall a. List a -> Nat
17-- Return the first element when present. An empty list produces None.
18head :: forall a. List a -> Option a
20-- Retain elements that satisfy the predicate, in their original order.
21filter :: forall a. (a -> Bool) -> List a -> List a