hmt-base-0.20: Haskell Music Theory Base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Music.Theory.Bool

Description

Boolean functions.

Synopsis

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"