Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
type family All (c :: k -> Constraint) (s :: [k]) :: Constraint where ... Source #
type family CRepr (s :: Schema) :: Type where ... Source #
CRepr (SchemaText cs) = TextConstraint | |
CRepr (SchemaNumber cs) = NumberConstraint | |
CRepr (SchemaObject fs) = (String, Schema) | |
CRepr (SchemaArray ar s) = ArrayConstraint |
data TextConstraint Source #
Generic TextConstraint Source # | |
Eq (Sing TextConstraint (TEq n)) Source # | |
Eq (Sing TextConstraint (TLe n)) Source # | |
Eq (Sing TextConstraint (TGt n)) Source # | |
Eq (Sing TextConstraint (TRegex t)) Source # | |
Eq (Sing TextConstraint (TEnum ss)) Source # | |
KnownNat n => Known (Sing TextConstraint (TEq n)) Source # | |
KnownNat n => Known (Sing TextConstraint (TLe n)) Source # | |
KnownNat n => Known (Sing TextConstraint (TGt n)) Source # | |
(KnownSymbol s, Known (Sing Symbol s)) => Known (Sing TextConstraint (TRegex s)) Source # | |
(All Symbol KnownSymbol ss, Known (Sing [Symbol] ss)) => Known (Sing TextConstraint (TEnum ss)) Source # | |
type Rep TextConstraint Source # | |
data Sing TextConstraint Source # | |
data NumberConstraint Source #
Generic NumberConstraint Source # | |
Eq (Sing NumberConstraint (NLe n)) Source # | |
Eq (Sing NumberConstraint (NGt n)) Source # | |
Eq (Sing NumberConstraint (NEq n)) Source # | |
KnownNat n => Known (Sing NumberConstraint (NLe n)) Source # | |
KnownNat n => Known (Sing NumberConstraint (NGt n)) Source # | |
KnownNat n => Known (Sing NumberConstraint (NEq n)) Source # | |
type Rep NumberConstraint Source # | |
data Sing NumberConstraint Source # | |
data ArrayConstraint Source #
Generic ArrayConstraint Source # | |
Eq (Sing ArrayConstraint (AEq n)) Source # | |
KnownNat n => Known (Sing ArrayConstraint (AEq n)) Source # | |
type Rep ArrayConstraint Source # | |
data Sing ArrayConstraint Source # | |
SchemaText [TextConstraint] | |
SchemaNumber [NumberConstraint] | |
SchemaObject [(Symbol, Schema)] | |
SchemaArray [ArrayConstraint] Schema | |
SchemaNull | |
SchemaOptional Schema |
data FieldRepr :: (Symbol, Schema) -> Type where Source #
FieldRepr :: (Known (Sing schema), KnownSymbol name) => JsonRepr schema -> FieldRepr '(name, schema) |
(KnownSymbol name, Known (Sing Schema schema), Serial m (JsonRepr schema)) => Serial m (FieldRepr ((,) Symbol Schema name schema)) Source # | |
Eq (JsonRepr schema) => Eq (FieldRepr ((,) Symbol Schema name schema)) Source # | |
Show (JsonRepr schema) => Show (FieldRepr ((,) Symbol Schema name schema)) Source # | |
knownFieldName :: forall proxy fieldName schema. KnownSymbol fieldName => proxy '(fieldName, schema) -> Text Source #
knownFieldSchema :: forall proxy fieldName schema. Known (Sing schema) => proxy '(fieldName, schema) -> Sing schema Source #
data JsonRepr :: Schema -> Type where Source #
ReprText :: Text -> JsonRepr (SchemaText cs) | |
ReprNumber :: Scientific -> JsonRepr (SchemaNumber cs) | |
ReprNull :: JsonRepr SchemaNull | |
ReprArray :: Vector (JsonRepr s) -> JsonRepr (SchemaArray cs s) | |
ReprObject :: Rec FieldRepr fs -> JsonRepr (SchemaObject fs) | |
ReprOptional :: Maybe (JsonRepr s) -> JsonRepr (SchemaOptional s) |
fromOptional :: Known (Sing s) => Sing (SchemaOptional s) -> Value -> Parser (Maybe (JsonRepr s)) Source #
class FalseConstraint a Source #
type family TopLevel (schema :: Schema) :: Constraint where ... Source #
TopLevel (SchemaArray acs s) = () | |
TopLevel (SchemaObject o) = () | |
TopLevel spec = FalseConstraint spec |