Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
simple-prompt SimplePrompt.Internal maybe map input or loop prompt
mapMaybe :: forall b a . (a -> Maybe b) -> Slist a -> Slist bslist Slist The Maybe version of map which can throw out elements. If appliying the given function returns Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.
>>> maybeEven x = if even x then Just x else Nothing >>> s = cons 1 $ cons 2 $ one 3
>>> mapMaybe maybeEven s Slist {sList = [2], sSize = Size 1}If we map the Just constructor, the entire list should be returned:>>> mapMaybe Just s Slist {sList = [1,2,3], sSize = Size 3}mapToKeys :: Map k v -> Slist kslist Slist O(n). Returns a Slist of all keys of the map in the ascending order.
mapToPairs :: Map k v -> Slist (k, v)slist Slist O(n). Returns a Slist of all key-value pairs of the map in the ascending order of their keys.
mapToVals :: Map k v -> Slist vslist Slist O(n). Returns a Slist of all values of the map in the ascending order of their keys.
mapToKeys :: Map k v -> Slist kslist Slist.Containers O(n). Returns a Slist of all keys of the map in the ascending order.
mapToPairs :: Map k v -> Slist (k, v)slist Slist.Containers O(n). Returns a Slist of all key-value pairs of the map in the ascending order of their keys.
mapToVals :: Map k v -> Slist vslist Slist.Containers O(n). Returns a Slist of all values of the map in the ascending order of their keys.
mapMaybe :: forall b a . (a -> Maybe b) -> Slist a -> Slist bslist Slist.Maybe The Maybe version of map which can throw out elements. If appliying the given function returns Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.
>>> maybeEven x = if even x then Just x else Nothing >>> s = cons 1 $ cons 2 $ one 3
>>> mapMaybe maybeEven s Slist {sList = [2], sSize = Size 1}If we map the Just constructor, the entire list should be returned:>>> mapMaybe Just s Slist {sList = [1,2,3], sSize = Size 3}mapGenerated :: Mapping -> !Possourcemap SourceMap.Types No documentation available.