Module
Data.Argonaut.Encode.Generic
- Package
- purescript-argonaut-generic
- Repository
- purescript-contrib/purescript-argonaut-generic
#EncodeRep Source
class EncodeRep r where
Members
encodeRepWith :: Encoding -> r -> Json
Instances
EncodeRep NoConstructors
(EncodeRep a, EncodeRep b) => EncodeRep (Sum a b)
(IsSymbol name, EncodeRepArgs a) => EncodeRep (Constructor name a)
#EncodeRepArgs Source
class EncodeRepArgs r where
Members
encodeRepArgs :: r -> Array Json
Instances
EncodeRepArgs NoArguments
(EncodeRepArgs a, EncodeRepArgs b) => EncodeRepArgs (Product a b)
(EncodeJson a) => EncodeRepArgs (Argument a)
#EncodeLiteral Source
class EncodeLiteral r where
Members
encodeLiteral :: (String -> String) -> r -> Json
Instances
(EncodeLiteral a, EncodeLiteral b) => EncodeLiteral (Sum a b)
(IsSymbol name) => EncodeLiteral (Constructor name NoArguments)
#genericEncodeJson Source
genericEncodeJson :: forall a r. Generic a r => EncodeRep r => a -> Json
Encode any Generic
data structure into Json
.
#genericEncodeJsonWith Source
genericEncodeJsonWith :: forall a r. Generic a r => EncodeRep r => Encoding -> a -> Json
Encode any Generic
data structure into Json
.
Takes a record for encoding settings.
#encodeLiteralSum Source
encodeLiteralSum :: forall a r. Generic a r => EncodeLiteral r => a -> Json
A function for encoding Generic
sum types using string literal representations.
#encodeLiteralSumWithTransform Source
encodeLiteralSumWithTransform :: forall a r. Generic a r => EncodeLiteral r => (String -> String) -> a -> Json
A function for encoding Generic
sum types using string literal representations.
Takes a function for transforming the tag name in encoding.