| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.List.EitherFunctions
Documentation
partlyMap :: (a -> Maybe b) -> [a] -> [Either a b] Source #
>>>import Prelude (even, show)
>>>partlyMap (\x -> if even x then Just (show x) else Nothing) [1..5][Left 1,Right "2",Left 3,Right "4",Left 5]
groupEither :: [Either a b] -> [Either [a] [b]] Source #
>>>groupEither [Left 1, Left 2, Right 'a', Left 3, Right 'b', Right 'c'][Left [1,2],Right "a",Left [3],Right "bc"]