Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Fcf.Utils
Contents
Description
Miscellaneous families.
Synopsis
- data Error (b :: Symbol) (c :: a)
- data TError (b :: ErrorMessage) (c :: a)
- data Constraints (a :: [Constraint]) b
- data TyEq (c :: a) (d :: b) (e :: Bool)
- type family Stuck :: a
- class IsBool (b :: Bool) where
- data Case (a :: [Match j k]) (b :: j) (c :: k)
- data Match j k
- type (-->) = 'Match_ :: j -> k -> Match j k
- type Is = 'Is_ :: (j -> Exp Bool) -> k -> Match j k
- type Any = 'Any_ :: k -> Match j k
- type Else = 'Else_ :: (j -> Exp k) -> Match j k
- type family If (cond :: Bool) (tru :: k) (fls :: k) :: k where ...
Documentation
data TError (b :: ErrorMessage) (c :: a) Source #
TypeError
as a fcf.
data Constraints (a :: [Constraint]) b Source #
Conjunction of a list of constraints.
Instances
type Eval (Constraints (a ': as) :: Constraint -> Type) Source # | |
Defined in Fcf.Utils | |
type Eval (Constraints ('[] :: [Constraint])) Source # | |
Defined in Fcf.Utils |
data Case (a :: [Match j k]) (b :: j) (c :: k) Source #
(Limited) equivalent of \case { .. }
syntax. Supports matching of exact
values (-->
) and final matches for any value (Any
) or for passing value
to subcomputation (Else
). Examples:
type BoolToNat =Case
[ 'True-->
0 , 'False-->
1 ] type NatToBool =Case
[ 0-->
'False ,Any
'True ] type ZeroOneOrSucc =Case
[ 0-->
0 , 1-->
1 ,Else
((+
) 1) ]
type Is = 'Is_ :: (j -> Exp Bool) -> k -> Match j k Source #
Match on predicate being successful with type in Case
.
type Any = 'Any_ :: k -> Match j k Source #
Match any type in Case
. Should be used as a final branch.
Note: this identifier conflicts with Any
(from Fcf.Class.Foldable)
Any
(from Data.Monoid), and Any
(from GHC.Exts).
We recommend importing this one qualified.
type Else = 'Else_ :: (j -> Exp k) -> Match j k Source #
Pass type being matched in Case
to subcomputation. Should be used as a
final branch.