aeson-extra-0.5.1.3: Extra goodies for aeson

Copyright | (C) 2015-2018 Oleg Grenrus
License | BSD3
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Aeson.Extra.SymTag

Description

Synopsis

- data SymTag (s :: Symbol) = SymTag

# Documentation

data SymTag (s :: Symbol) Source #

Singleton string encoded and decoded as ifself.

    λ> encode (SymTag :: SymTag "foobar")
    "\"foobar\""

    decode "\"foobar\"" :: Maybe (SymTag "foobar")
    Just SymTag

    decode "\"foobar\"" :: Maybe (SymTag "barfoo")
    Nothing

Available with: base >=4.7

Constructors

SymTag |

#### Instances

Instances details

KnownSymbol s => FromJSON (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods parseJSON :: Value -> Parser (SymTag s) Source # parseJSONList :: Value -> Parser [SymTag s] Source #
KnownSymbol s => ToJSON (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods toJSON :: SymTag s -> Value Source # toEncoding :: SymTag s -> Encoding Source # toJSONList :: [SymTag s] -> Value Source # toEncodingList :: [SymTag s] -> Encoding Source #
Bounded (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods minBound :: SymTag s Source # maxBound :: SymTag s Source #
Enum (SymTag s) Source # |

Instance details

Defined in Data.Aeson.Extra.SymTag

Methods

succ :: SymTag s -> SymTag s Source #

pred :: SymTag s -> SymTag s Source #

toEnum :: Int -> SymTag s Source #

fromEnum :: SymTag s -> Int Source #

enumFrom :: SymTag s -> [SymTag s] Source #

enumFromThen :: SymTag s -> SymTag s -> [SymTag s] Source #

enumFromTo :: SymTag s -> SymTag s -> [SymTag s] Source #

enumFromThenTo :: SymTag s -> SymTag s -> SymTag s -> [SymTag s] Source #

Read (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods readsPrec :: Int -> ReadS (SymTag s) Source # readList :: ReadS [SymTag s] Source # readPrec :: ReadPrec (SymTag s) Source # readListPrec :: ReadPrec [SymTag s] Source #
Show (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods showsPrec :: Int -> SymTag s -> ShowS Source # show :: SymTag s -> String Source # showList :: [SymTag s] -> ShowS Source #
NFData (SymTag s) Source # | Since: 0.4.1.0
Instance details Defined in Data.Aeson.Extra.SymTag Methods rnf :: SymTag s -> () Source #
Eq (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods (==) :: SymTag s -> SymTag s -> Bool Source # (/=) :: SymTag s -> SymTag s -> Bool Source #
Ord (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods compare :: SymTag s -> SymTag s -> Ordering Source # (<) :: SymTag s -> SymTag s -> Bool Source # (<=) :: SymTag s -> SymTag s -> Bool Source # (>) :: SymTag s -> SymTag s -> Bool Source # (>=) :: SymTag s -> SymTag s -> Bool Source # max :: SymTag s -> SymTag s -> SymTag s Source # min :: SymTag s -> SymTag s -> SymTag s Source #