Module
Yoga.JSON.Variant
- Package
- purescript-yoga-json
- Repository
- rowtype-yoga/purescript-yoga-json
#TaggedVariant Source
newtype TaggedVariant :: Symbol -> Symbol -> Row Type -> Type
newtype TaggedVariant tt vt v
Constructors
TaggedVariant (Variant v)
Instances
Newtype (TaggedVariant tt vt v) (Variant v)
(Show (Variant v)) => Show (TaggedVariant tt vt v)
(Eq (Variant v)) => Eq (TaggedVariant tt vt v)
(RowToList row rl, WriteForeignTaggedVariant rl row, IsSymbol typeTag, IsSymbol valueTag) => WriteForeign (TaggedVariant typeTag valueTag row)
(RowToList variants rl, ReadForeignTaggedVariant typeTag valueTag rl variants, IsSymbol typeTag, IsSymbol valueTag) => ReadForeign (TaggedVariant typeTag valueTag variants)
#WriteForeignTaggedVariant Source
class WriteForeignTaggedVariant :: RowList Type -> Row Type -> Constraint
class WriteForeignTaggedVariant (rl :: RowList Type) (row :: Row Type) | rl -> row where
Members
writeVariantImpl :: forall g. String -> String -> g rl -> Variant row -> Foreign
Instances
WriteForeignTaggedVariant Nil ()
(IsSymbol name, WriteForeign ty, Cons name ty subRow row, WriteForeignTaggedVariant tail subRow) => WriteForeignTaggedVariant (Cons name ty tail) row
#ReadForeignTaggedVariant Source
class ReadForeignTaggedVariant :: Symbol -> Symbol -> RowList Type -> Row Type -> Constraint
class ReadForeignTaggedVariant typeTag valueTag (xs :: RowList Type) (row :: Row Type) | xs -> row where
Members
readVariantImpl :: Proxy xs -> Foreign -> F (TaggedVariant typeTag valueTag row)
Instances
ReadForeignTaggedVariant typeTag valueTag Nil trash
(IsSymbol name, IsSymbol typeTag, IsSymbol valueTag, ReadForeign ty, Cons name ty trash row, ReadForeignTaggedVariant typeTag valueTag tail row) => ReadForeignTaggedVariant typeTag valueTag (Cons name ty tail) row
#UntaggedVariant Source
newtype UntaggedVariant :: Row Type -> Type
newtype UntaggedVariant v
Constructors
Instances
Newtype (UntaggedVariant v) (Variant v)
(Show (Variant v)) => Show (UntaggedVariant v)
(Eq (Variant v)) => Eq (UntaggedVariant v)
(RowToList row rl, WriteForeignUntaggedVariant rl row) => WriteForeign (UntaggedVariant row)
(RowToList variants rl, ReadForeignUntaggedVariant rl variants) => ReadForeign (UntaggedVariant variants)
#WriteForeignUntaggedVariant Source
class WriteForeignUntaggedVariant :: RowList Type -> Row Type -> Constraint
class WriteForeignUntaggedVariant (rl :: RowList Type) (row :: Row Type) | rl -> row where
Members
writeUntaggedVariantImpl :: forall g. g rl -> Variant row -> Foreign
Instances
WriteForeignUntaggedVariant Nil ()
(IsSymbol name, WriteForeign ty, Cons name ty subRow row, WriteForeignUntaggedVariant tail subRow) => WriteForeignUntaggedVariant (Cons name ty tail) row
#ReadForeignUntaggedVariant Source
class ReadForeignUntaggedVariant :: RowList Type -> Row Type -> Constraint
class ReadForeignUntaggedVariant (xs :: RowList Type) (row :: Row Type) | xs -> row where
Members
readUntaggedVariantImpl :: Proxy xs -> Foreign -> F (UntaggedVariant row)
Instances
ReadForeignUntaggedVariant Nil trash
(IsSymbol name, ReadForeign ty, Cons name ty trash row, ReadForeignUntaggedVariant tail row) => ReadForeignUntaggedVariant (Cons name ty tail) row