-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Structural assertions on generic data representations. -- -- Please see README.md. @package generic-data-asserts @version 0.1.1 -- | Structural assertions on generic data representation. module Generic.Data.Rep.Assert type GAssertError a msg = TypeError ('Text "Assertion on generic representation failed for type: " :<>: 'ShowType a :$$: 'Text "Message: " :<>: 'Text msg) type family StripD1 a -- | Type is not void i.e. has at least one constructor. type GAssertNotVoid a = Assert (IsNotVoid (StripD1 (Rep a))) (GAssertError a "not non-void type (>=1 constructor)") type family IsNotVoid a -- | Type is not a sum type i.e. has at most one constructor. -- -- Permits void types. type GAssertNotSum a = Assert (IsNotSum (StripD1 (Rep a))) (GAssertError a "not non-sum type (1 constructor)") type family IsNotSum a -- | Type is a sum type i.e. has >=2 constructors. -- -- Permits void types. type GAssertSum a = Assert (IsSum (StripD1 (Rep a))) (GAssertError a "not sum type (>=2 constructors)") type family IsSum a -- | Type has only empty constructors. -- -- Permits void types. type GAssertEnum a = Assert (IsEnum (StripD1 (Rep a))) (GAssertError a "not enum type (all empty constructors)") type family IsEnum a type family ConsIsEmpty a -- | Type level boolean AND. type family And l r