aeson-extra-0.4.1.3: Extra goodies for aeson

Copyright | (C) 2015-2018 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 :: 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

Bounded (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods minBound :: SymTag s maxBound :: SymTag s
Enum (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag 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 # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods (==) :: SymTag s -> SymTag s -> Bool (/=) :: SymTag s -> SymTag s -> Bool
Ord (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag 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 # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods readsPrec :: Int -> ReadS (SymTag s) readList :: ReadS [SymTag s] readPrec :: ReadPrec (SymTag s) readListPrec :: ReadPrec [SymTag s]
Show (SymTag s) Source # |
Instance details Defined in Data.Aeson.Extra.SymTag Methods showsPrec :: Int -> SymTag s -> ShowS show :: SymTag s -> String showList :: [SymTag s] -> ShowS
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 #
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 #
NFData (SymTag s) Source # | Since: 0.4.1.0
Instance details Defined in Data.Aeson.Extra.SymTag Methods rnf :: SymTag s -> ()