|
Module Java/CollectionThis module is undocumented. This is a list of its definitions. all :: (a -> <b> Boolean) -> Collection a -> <b> Boolean Returns any :: (a -> <b> Boolean) -> Collection a -> <b> Boolean Returns contains :: Collection a -> a -> Boolean Returns find :: (a -> <b> Boolean) -> Collection a -> <b> Maybe a The first value of the collection that satisfies the given predicate, or foldl :: (a -> b -> <c> a) -> a -> Collection b -> <c> a Folds over the values of the collection starting with the given initial value. foldl1 :: (a -> a -> <b> a) -> Collection a -> <b> a Like There is no initial value to fall back on, so Which value is taken as the initial one depends on the iteration order of the
collection, which for a set or a map is not specified. The folded function
should therefore be associative and commutative, as Example:
isEmpty :: Collection a -> Boolean Returns iter :: (a -> <c> b) -> Collection a -> <c> () Calls the given function with all values of the collection. mapFirst :: (a -> <c> Maybe b) -> Collection a -> <c> Maybe b Applies the given function to the values of the collection until it returns
It is a search and a map in one: use it instead of size :: Collection a -> Integer The number of values in the collection. uniqueElement :: Collection a -> a The only value of the collection. This is not a way to take the first value out of a collection. It fails with
the message Example:
|