NumericPrelude-0.0: An experimental alternative hierarchy of numeric type classesContentsIndex
NumericPrelude.Condition
Synopsis
toMaybe :: Bool -> a -> Maybe a
if' :: Bool -> a -> a -> a
select :: a -> [(Bool, a)] -> a
implies :: Bool -> Bool -> Bool
Documentation
toMaybe :: Bool -> a -> Maybe a
Returns Just if the precondition is fulfilled.
if'
:: Boolcondition
-> athen
-> aelse
-> a
A purely functional implementation of if. Very useful in connection with zipWith3.
select :: a -> [(Bool, a)] -> a

From a list of expressions choose the one, whose condition is true.

   select "zero"
          [(x>0, "positive"),
           (x<0, "negative")]
implies :: Bool -> Bool -> Bool

Logical operator for implication.

Funnily because of the ordering of Bool it holds implies == (<=).

Produced by Haddock version 0.7