Copyright | (c) Conal Elliott 2010 |
---|---|
License | BSD3 |
Maintainer | conal@conal.net |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Some laxer operations. See http://conal.net/blog/posts/lazier-functional-programming-part-2/
Synopsis
- eitherL :: (HasLub c, HasGlb c) => (a -> c) -> (b -> c) -> Either a b -> c
- condL :: (HasLub a, HasGlb a) => a -> a -> Bool -> a
- foldrL :: (HasLub b, HasGlb b) => (a -> b -> b) -> b -> [a] -> b
- maybeL :: (HasLub b, HasGlb b) => b -> (a -> b) -> Maybe a -> b
- fairZipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- fairZip :: [a] -> [b] -> [(a, b)]
Documentation
eitherL :: (HasLub c, HasGlb c) => (a -> c) -> (b -> c) -> Either a b -> c Source #
Laxer variant of either
condL :: (HasLub a, HasGlb a) => a -> a -> Bool -> a Source #
Laxer if-then-else, due to Luke Palmer.
condL a a undefined = a condL (Left 3) (Left undefined) undefined = Left undefined
foldrL :: (HasLub b, HasGlb b) => (a -> b -> b) -> b -> [a] -> b Source #
Laxer variant of foldr
for lists
fairZipWith :: (a -> b -> c) -> [a] -> [b] -> [c] Source #
A version of zipWith
that succeeds if either list
ends at the same time the other one bottoms out.
Laws:
fairZipWith >= zipWith flip . fairZipWith = fairZipWith . flip