|
|
| filter :: (a -> Bool) -> [a] -> [a] | | filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., filter p xs = [ x | x <- xs, p x] |
|
|
|
| last :: [a] -> a | | Return the last element in the list. The list must be non-empty. |
|
|
|
|
| length :: [a] -> Int | | length returns the length of a finite list as an Int; it is an instance of the more general genericLength, the result type of which may be any kind of number. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data Maybe | = | | Nothing | | | | Just a |
| | |
|
data Either | = | | Left a | | | | Right b |
| | |
|
|
|
|
|
|
|
|
|
|
| | All basic datatypes except for functions and IO are instances of this class. Instances of Eq can be derived for any user-defined datatype whose constituents are also instances of Eq. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|