aeson-extra-0.4.0.0: Extra goodies for aeson

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

Data.Aeson.Extra.SymTag

Description

Synopsis

- data SymTag s = SymTag

# Documentation

data SymTag s 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

Bounded (SymTag s) Source # |
Methods minBound :: SymTag s # maxBound :: SymTag s #
Enum (SymTag s) Source # |
Methods succ :: SymTag s -> SymTag s # pred :: SymTag s -> SymTag s # toEnum :: Int -> SymTag s # fromEnum :: SymTag s -> Int # enumFrom :: SymTag s -> [SymTag s] # enumFromThen :: SymTag s -> SymTag s -> [SymTag s] # enumFromTo :: SymTag s -> SymTag s -> [SymTag s] # enumFromThenTo :: SymTag s -> SymTag s -> SymTag s -> [SymTag s] #
Eq (SymTag s) Source # |
Methods (==) :: SymTag s -> SymTag s -> Bool # (/=) :: SymTag s -> SymTag s -> Bool #
Ord (SymTag s) Source # |
Methods compare :: SymTag s -> SymTag s -> Ordering # (<) :: SymTag s -> SymTag s -> Bool # (<=) :: SymTag s -> SymTag s -> Bool # (>) :: SymTag s -> SymTag s -> Bool # (>=) :: SymTag s -> SymTag s -> Bool # max :: SymTag s -> SymTag s -> SymTag s # min :: SymTag s -> SymTag s -> SymTag s #
Read (SymTag s) Source # |
Methods readsPrec :: Int -> ReadS (SymTag s) # readList :: ReadS [SymTag s] # readPrec :: ReadPrec (SymTag s) # readListPrec :: ReadPrec [SymTag s] #
Show (SymTag s) Source # |
Methods showsPrec :: Int -> SymTag s -> ShowS # show :: SymTag s -> String # showList :: [SymTag s] -> ShowS #
KnownSymbol s => ToJSON (SymTag s) Source # |
Methods toJSON :: SymTag s -> Value # toEncoding :: SymTag s -> Encoding # toJSONList :: [SymTag s] -> Value # toEncodingList :: [SymTag s] -> Encoding #
KnownSymbol s => FromJSON (SymTag s) Source # |
Methods parseJSON :: Value -> Parser (SymTag s) # parseJSONList :: Value -> Parser [SymTag s] #