numeric-prelude-0.0.2: An experimental alternative hierarchy of numeric type classesSource codeContentsIndex
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 aSource
Returns Just if the precondition is fulfilled.
if'Source
::
=> Boolthen
-> aelse
-> a
-> a
A purely functional implementation of if. Very useful in connection with zipWith3.
select :: a -> [(Bool, a)] -> aSource

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

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

Logical operator for implication.

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

Produced by Haddock version 2.6.0