Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Boolean functions.
Synopsis
- ifThenElse :: Bool -> a -> a -> a
- caseElse :: t -> [(Bool, t)] -> t
- caseOfElse :: Eq k => v -> k -> [(k, v)] -> v
Documentation
ifThenElse :: Bool -> a -> a -> a Source #
If-then-else as a function.
ifThenElse True "true" "false" == "true"
caseElse :: t -> [(Bool, t)] -> t Source #
Case analysis as a function. Find first key that is True else elseValue.
caseElse "z" [(True,"x"),(False,"y")] == "x" caseElse "z" [(False,"x"),(False,"y")] == "z"
caseOfElse :: Eq k => v -> k -> [(k, v)] -> v Source #
Case-of analysis as a function. Find first key that compares equal to selectValue else elseValue.
caseOfElse "z" 'b' [('a',"x"),('b',"y")] == "y"