Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Schematic.DSL
Documentation
type Constructor a = forall b. FSubset (FieldsOf a) b (FImage (FieldsOf a) b) => Rec (Tagged (FieldsOf a) :. FieldRepr) b -> JsonRepr (SchemaObject (FieldsOf a)) #
withRepr :: Constructor a #
class Representable s where #
Minimal complete definition
Instances
Representable SchemaBoolean # | |
SingI [TextConstraint] cs => Representable (SchemaText cs) # | |
SingI [NumberConstraint] cs => Representable (SchemaNumber cs) # | |
SingI [(Symbol, Schema)] so => Representable (SchemaObject so) # | |
SingI Schema so => Representable (SchemaOptional so) # | |
SingI [Schema] ((:) Schema h tl) => Representable (SchemaUnion ((:) Schema h tl)) # | |
(SingI [ArrayConstraint] cs, SingI Schema sa) => Representable (SchemaArray cs sa) # | |
type family FieldsOf (s :: Schema) :: [(Symbol, Schema)] where ... #
Equations
FieldsOf (SchemaObject fs) = fs |
type FieldConstructor fn = forall fs. Representable (ByField fn fs (FIndex fn fs)) => Repr (ByField fn fs (FIndex fn fs)) -> (Tagged fs :. FieldRepr) '(fn, ByField fn fs (FIndex fn fs)) #
field :: forall fn. KnownSymbol fn => FieldConstructor fn #
type family Repr (s :: Schema) = (ty :: Type) where ... #
Equations
Repr (SchemaObject so) = Rec FieldRepr so | |
Repr (SchemaArray cs sa) = Vector (JsonRepr sa) | |
Repr (SchemaText cs) = Text | |
Repr (SchemaNumber cs) = Scientific | |
Repr SchemaBoolean = Bool | |
Repr (SchemaOptional so) = Maybe (JsonRepr so) | |
Repr (SchemaUnion (h ': tl)) = Union JsonRepr (h ': tl) |