Module
Kishimen
- Package
- purescript-kishimen
- Repository
- justinwoo/purescript-kishimen
#genericSumToVariant Source
genericSumToVariant :: forall r rep a. Generic a rep => GenericSumToVariant rep r => a -> Variant r
Convert a generic sum into a variant
#variantToGenericSum Source
variantToGenericSum :: forall r rep a. Generic a rep => GenericSumToVariant rep r => Variant r -> a
Convert a variant into a generic sum, where the type of the sum determines the type of the variant, because you could not construct the sum otherwise. This also means that we can recover from the alternative introduced when expanding and contracting the Variant rows.
#GenericSumToVariant Source
class GenericSumToVariant rep (r :: Row Type) | rep -> r where
Give Generic Sum Rep, get Variant
Members
genericSumToVariantImpl :: rep -> Variant r
variantImplToGenericSumImpl :: Variant r -> Maybe rep
Instances
(IsSymbol name, Cons name ty () r, GenericSumToVariantArg a ty) => GenericSumToVariant (Constructor name a) r
(GenericSumToVariant a ra, GenericSumToVariant b rb, Union ra ra' r, Union rb rb' r, Union ra rb r, RowToList ra raL, VariantTags raL, RowToList rb rbL, VariantTags rbL) => GenericSumToVariant (Sum a b) r
#GenericSumToVariantArg Source
class GenericSumToVariantArg rep out | rep -> out where
Give Generic Rep, get Type
Members
genericSumToVariantArgImpl :: rep -> out
variantArgImplToGenericSumImpl :: out -> rep
Instances
- Modules
- Kishimen
NoArg encoded as empty record, for convenience (e.g. JSON)