|
Module Java/IteratorThis module is undocumented. This is a list of its definitions. all :: (a -> <b> Boolean) -> Iterator a -> <Proc,b> Boolean Returns any :: (a -> <b> Boolean) -> Iterator a -> <Proc,b> Boolean Returns find :: (a -> <b> Boolean) -> Iterator a -> <Proc,b> Maybe a The first remaining value of the iterator that satisfies the given predicate,
or The search consumes the iterator up to and including the value it returns, so
what is left of the iterator afterwards are the values after the match. See
foldl :: (a -> b -> <c> a) -> a -> Iterator b -> <Proc,c> a Folds over the remaining values of the iterator starting with the given initial value. foldl1 :: (a -> a -> <b> a) -> Iterator a -> <Proc,b> a Like There is no initial value to fall back on, so Example:
The two coercions are only how the example gets hold of an iterator: an SCL
list is a Java hasNext :: Iterator a -> <Proc> Boolean Returns iter :: (a -> <c> b) -> Iterator a -> <Proc,c> () Calls the given function with all remaining values of the iterator. mapFirst :: (a -> <c> Maybe b) -> Iterator a -> <Proc,c> Maybe b Applies the given function to the remaining values of the iterator until it
returns It is a search and a map in one, and like next :: Iterator a -> <Proc> a Advances the iterator and returns the next value. Fails if the iterator has no more values. |