named-text-1.1.1.0: A parameterized named text type and associated functionality.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Name.JSON

Description

This module provides a JSONStyle Named style that can be used for JSON encoding/decoding. It also provides conversion to and from that style from the regular UTF8 style, as well as an "aeson" ToJSON and FromJSON instance.

Synopsis

Documentation

type JSONStyle = "JSON" :: NameStyle Source #

The JSONStyle of Named objects can be directly transformed to and from JSON (via Aeson's ToJSON and FromJSON classes). The Named nameOf is not represented in the JSON form; field names are expected to be provided by the Named field name itself. Bi-directional conversions between the JSON style and the UTF8 style is automatic.

Orphan instances

NameText JSONStyle Source # 
Instance details

Methods

nameText :: forall (nm :: Symbol). Named JSONStyle nm -> Text Source #

ConvertNameStyle CaseInsensitive JSONStyle nameOf Source # 
Instance details

ConvertNameStyle UTF8 JSONStyle nameOf Source # 
Instance details

Methods

convertStyle :: Named UTF8 nameOf -> Named JSONStyle nameOf Source #

ConvertNameStyle JSONStyle CaseInsensitive nameOf Source # 
Instance details

ConvertNameStyle JSONStyle UTF8 nameOf Source # 
Instance details

Methods

convertStyle :: Named JSONStyle nameOf -> Named UTF8 nameOf Source #

FromJSON (Name nameTy) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (Name nameTy) #

parseJSONList :: Value -> Parser [Name nameTy] #

FromJSONKey (Name nameTy) Source # 
Instance details

ToJSON (Name nameTy) Source # 
Instance details

Methods

toJSON :: Name nameTy -> Value #

toEncoding :: Name nameTy -> Encoding #

toJSONList :: [Name nameTy] -> Value #

toEncodingList :: [Name nameTy] -> Encoding #

ToJSONKey (Name nameTy) Source # 
Instance details

FromJSON (Named CaseInsensitive nameTy) Source # 
Instance details

FromJSON (Named JSONStyle nameTy) Source # 
Instance details

FromJSONKey (Named CaseInsensitive nameTy) Source # 
Instance details

FromJSONKey (Named JSONStyle nameTy) Source # 
Instance details

ToJSON (Named CaseInsensitive nameTy) Source # 
Instance details

ToJSON (Named JSONStyle nameTy) Source # 
Instance details

ToJSONKey (Named CaseInsensitive nameTy) Source # 
Instance details

ToJSONKey (Named JSONStyle nameTy) Source # 
Instance details