| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.OpenApi.Internal.TypeShape
Synopsis
- data TypeShape
- type family ProdCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ...
- type family SumCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ...
- type family TypeHasSimpleShape t (f :: Symbol) where ...
- type family GenericHasSimpleShape t (f :: Symbol) (s :: TypeShape) where ...
- type family GenericShape (g :: Type -> Type) :: TypeShape
Documentation
Shape of a datatype.
Constructors
| Enumeration | A simple enumeration. |
| SumOfProducts | A product or a sum of non-unit products. |
| Mixed | Mixed sum type with both unit and non-unit constructors. |
type family ProdCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ... Source #
A combined shape for a product type.
Equations
| ProdCombine 'Mixed b = 'Mixed | |
| ProdCombine a 'Mixed = 'Mixed | |
| ProdCombine a b = 'SumOfProducts |
type family SumCombine (a :: TypeShape) (b :: TypeShape) :: TypeShape where ... Source #
A combined shape for a sum type.
Equations
| SumCombine 'Enumeration 'Enumeration = 'Enumeration | |
| SumCombine 'SumOfProducts 'SumOfProducts = 'SumOfProducts | |
| SumCombine a b = 'Mixed |
type family TypeHasSimpleShape t (f :: Symbol) where ... Source #
Equations
| TypeHasSimpleShape t f = GenericHasSimpleShape t f (GenericShape (Rep t)) |
type family GenericHasSimpleShape t (f :: Symbol) (s :: TypeShape) where ... Source #
Equations
| GenericHasSimpleShape t f 'Enumeration = () | |
| GenericHasSimpleShape t f 'SumOfProducts = () | |
| GenericHasSimpleShape t f 'Mixed = TypeError (((((('Text "Cannot derive Generic-based Swagger Schema for " ':<>: 'ShowType t) ':$$: ('ShowType t ':<>: 'Text " is a mixed sum type (has both unit and non-unit constructors).")) ':$$: 'Text "Swagger does not have a good representation for these types.") ':$$: (('Text "Use " ':<>: 'Text f) ':<>: 'Text " if you want to derive schema")) ':$$: 'Text "that matches aeson's Generic-based toJSON,") ':$$: 'Text "but that's not supported by some Swagger tools.") :: Constraint |
type family GenericShape (g :: Type -> Type) :: TypeShape Source #
Infer a TypeShape for a generic representation of a type.
Instances
| type GenericShape (f :*: g) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |
| type GenericShape (f :+: g) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |
| type GenericShape (C1 c (f :*: g)) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |
| type GenericShape (C1 c (S1 s f)) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |
| type GenericShape (C1 c (U1 :: Type -> Type)) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |
| type GenericShape (D1 d f) Source # | |
Defined in Data.OpenApi.Internal.TypeShape | |