| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Schema.Internal.Types
Synopsis
- data FieldDef o s a where
- RequiredField :: Text -> s a -> Getter o a -> FieldDef o s a
- OptionalField :: Text -> s a -> Getter o (Maybe a) -> FieldDef o s (Maybe a)
- fieldName :: FieldDef o s a -> Text
- newtype Field s o a = Field {
- unwrapField :: Ap (FieldDef o s) a
- hoistField :: (m ~> n) -> Field m o a -> Field n o a
- type Fields s o = Field s o o
- field :: Text -> s a -> Getter o a -> Field s o a
- optional :: Text -> s a -> Getter o (Maybe a) -> Field s o (Maybe a)
- data AltDef s a = AltDef {}
- data SchemaF p s a where
- PrimitiveSchema :: p a -> SchemaF p s a
- RecordSchema :: Fields s a -> SchemaF p s a
- UnionSchema :: NonEmpty (AltDef s a) -> SchemaF p s a
- AliasSchema :: s a -> Iso' a b -> SchemaF p s b
- newtype Schema p a = Schema {
- unwrapSchema :: HFix (SchemaF p) a
- class HasSchema a where
- type PrimitivesOf a :: * -> *
- getSchema :: Schema (PrimitivesOf a) a
Documentation
data FieldDef o s a where Source #
Metadata for a field of type a, belonging to the data type o and based on schema s
Constructors
| RequiredField :: Text -> s a -> Getter o a -> FieldDef o s a | |
| OptionalField :: Text -> s a -> Getter o (Maybe a) -> FieldDef o s (Maybe a) |
The type of a field of type a, belonging to the data type o and based on schema s
Constructors
| Field | |
Fields
| |
Instances
| Profunctor (Field s) Source # | |
Defined in Data.Schema.Internal.Types | |
| Functor (Field s o) Source # | |
| Applicative (Field s o) Source # | |
Defined in Data.Schema.Internal.Types | |
Metadata for an alternative of type a based on schema s
data SchemaF p s a where Source #
Metadata for a schema s based on primitives p and representing type a
Constructors
| PrimitiveSchema :: p a -> SchemaF p s a | |
| RecordSchema :: Fields s a -> SchemaF p s a | |
| UnionSchema :: NonEmpty (AltDef s a) -> SchemaF p s a | |
| AliasSchema :: s a -> Iso' a b -> SchemaF p s b |
The Schema type itself for a set of primitives p
Constructors
| Schema | |
Fields
| |