lub-0.1.8: information operators: least upper bound (lub) and greatest lower bound (glb)
Copyright(c) Conal Elliott 2010
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Laxer

Description

Synopsis

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

maybeL :: (HasLub b, HasGlb b) => b -> (a -> b) -> Maybe a -> b Source #

Laxer variant of maybe

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

fairZip :: [a] -> [b] -> [(a, b)] Source #

fairZip = fairZipWith (,)