schematic-0.4.2.0: JSON-biased spec and validation tool

Safe HaskellNone
LanguageHaskell2010

Data.Schematic.DSL

Documentation

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 # 
SingI [TextConstraint] cs => Representable (SchemaText cs) Source # 
SingI [NumberConstraint] cs => Representable (SchemaNumber cs) Source # 
SingI [(Symbol, Schema)] so => Representable (SchemaObject so) Source # 
SingI Schema so => Representable (SchemaOptional so) Source # 
SingI [Schema] ((:) Schema h tl) => Representable (SchemaUnion ((:) Schema h tl)) Source # 

Methods

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

(SingI [ArrayConstraint] cs, SingI Schema sa) => Representable (SchemaArray cs sa) Source # 

Methods

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

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

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)) Source #

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

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