Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Structural assertions on generic data representation.
Synopsis
- type GAssertError a msg = TypeError (('Text "Assertion on generic representation failed for type: " :<>: 'ShowType a) :$$: ('Text "Message: " :<>: 'Text msg))
- type family StripD1 a where ...
- type GAssertNotVoid a = Assert (IsNotVoid (StripD1 (Rep a))) (GAssertError a "not non-void type (>=1 constructor)")
- type family IsNotVoid a where ...
- type GAssertNotSum a = Assert (IsNotSum (StripD1 (Rep a))) (GAssertError a "not non-sum type (1 constructor)")
- type family IsNotSum a where ...
- type GAssertSum a = Assert (IsSum (StripD1 (Rep a))) (GAssertError a "not sum type (>=2 constructors)")
- type family IsSum a where ...
- type GAssertEnum a = Assert (IsEnum (StripD1 (Rep a))) (GAssertError a "not enum type (all empty constructors)")
- type family IsEnum a where ...
- type family ConsIsEmpty a where ...
- type family And l r where ...
Documentation
type GAssertError a msg = TypeError (('Text "Assertion on generic representation failed for type: " :<>: 'ShowType a) :$$: ('Text "Message: " :<>: 'Text msg)) Source #
type GAssertNotVoid a = Assert (IsNotVoid (StripD1 (Rep a))) (GAssertError a "not non-void type (>=1 constructor)") Source #
Type is not void i.e. has at least one constructor.
type GAssertNotSum a = Assert (IsNotSum (StripD1 (Rep a))) (GAssertError a "not non-sum type (1 constructor)") Source #
Type is not a sum type i.e. has at most one constructor.
Permits void types.
type GAssertSum a = Assert (IsSum (StripD1 (Rep a))) (GAssertError a "not sum type (>=2 constructors)") Source #
Type is a sum type i.e. has >=2 constructors.
Permits void types.
type GAssertEnum a = Assert (IsEnum (StripD1 (Rep a))) (GAssertError a "not enum type (all empty constructors)") Source #
Type has only empty constructors.
Permits void types.
type family ConsIsEmpty a where ... Source #
ConsIsEmpty U1 = True | |
ConsIsEmpty _ = False |