|
|
|
Description |
Some classes for generalized boolean operations.
In this design, for if-then-else, equality and inequality tests, the
boolean type depends functionally on the value type. This dependency
allows the boolean type to be inferred in a conditional expression.
I also tried using a unary type constructor class. The class doesn't work
for regular booleans, so generality is lost. Also, we'd probably have
to wire class constraints in like: (==*) :: Eq a => f Bool -> f a -> f
a -> f a, which disallows situations needing additional constraints,
e.g., Show.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Generalized boolean class
| | Methods | | | Instances | |
|
|
|
Types with conditionals
| | Methods | ifB :: bool -> a -> a -> a | Source |
|
| | Instances | IfB Bool Float | IfB Bool Float | (IfB bool p, IfB bool q) => IfB bool ((,) p q) | (IfB bool p, IfB bool q, IfB bool r) => IfB bool ((,,) p q r) | (IfB bool p, IfB bool q, IfB bool r, IfB bool s) => IfB bool ((,,,) p q r s) | IfB bool a => IfB (z -> bool) (z -> a) |
|
|
|
boolean :: IfB bool a => a -> a -> bool -> a | Source |
|
Expression-lifted conditional with condition last
|
|
|
Point-wise conditional
|
|
|
Crop a function, filling in mempty where the test yeis false.
|
|
|
Types with equality. Minimum definition: '(==*)'.
| | Methods | | | Instances | |
|
|
|
Types with inequality. Minimum definition: '(<*)'.
| | Methods | | | Instances | |
|
|
Produced by Haddock version 2.4.2 |