schematic-0.5.0.0: JSON-biased spec and validation tool

Safe HaskellNone
LanguageHaskell2010

Data.Schematic.DSL

Documentation

type Constructor a = forall fields b. (fields ~ FieldsOf a, FSubset fields b (FImage fields b)) => Rec (Tagged fields :. FieldRepr) b -> JsonRepr (SchemaObject fields) Source #

class Representable s where Source #

Minimal complete definition

constructField

Methods

constructField :: Sing fn -> Proxy s -> Repr s -> FieldRepr '(fn, s) Source #

Instances
Representable SchemaBoolean Source # 
Instance details

Defined in Data.Schematic.DSL

SingI cs => Representable (SchemaText cs) Source # 
Instance details

Defined in Data.Schematic.DSL

Methods

constructField :: Sing fn -> Proxy (SchemaText cs) -> Repr (SchemaText cs) -> FieldRepr (fn, SchemaText cs) Source #

SingI cs => Representable (SchemaNumber cs) Source # 
Instance details

Defined in Data.Schematic.DSL

SingI so => Representable (SchemaObject so) Source # 
Instance details

Defined in Data.Schematic.DSL

SingI so => Representable (SchemaOptional so) Source # 
Instance details

Defined in Data.Schematic.DSL

SingI (h ': tl) => Representable (SchemaUnion (h ': tl)) Source # 
Instance details

Defined in Data.Schematic.DSL

Methods

constructField :: Sing fn -> Proxy (SchemaUnion (h ': tl)) -> Repr (SchemaUnion (h ': tl)) -> FieldRepr (fn, SchemaUnion (h ': tl)) Source #

(SingI cs, SingI sa) => Representable (SchemaArray cs sa) Source # 
Instance details

Defined in Data.Schematic.DSL

Methods

constructField :: Sing fn -> Proxy (SchemaArray cs sa) -> Repr (SchemaArray cs sa) -> FieldRepr (fn, SchemaArray cs sa) Source #

type family FieldsOf (s :: Schema) :: [(Symbol, Schema)] where ... Source #

Equations

FieldsOf (SchemaObject fs) = fs 

type FieldConstructor fn = forall byField fs. (byField ~ ByField fn fs (FIndex fn fs), Representable byField) => Repr byField -> (Tagged fs :. FieldRepr) '(fn, byField) Source #

field :: forall fn. KnownSymbol fn => FieldConstructor fn Source #

type family Repr (s :: Schema) = (ty :: Type) where ... Source #