aeson-extra-0.4.1.3: Extra goodies for aeson

Copyright(C) 2015-2016 Oleg Grenrus
LicenseBSD3
MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Extra.Map

Description

Deprecated: Use aeson-1 TOJSONKey etc functionality

More or less useful newtypes for writing FromJSON & ToJSON instances

Synopsis

Documentation

newtype M a Source #

A wrapper type to parse arbitrary maps

λ > decode "{\"1\": 1, \"2\": 2}" :: Maybe (M (H.HashMap Int Int))
Just (M {getMap = fromList [(1,1),(2,2)]})

Constructors

M 

Fields

Instances
Functor M Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

fmap :: (a -> b) -> M a -> M b #

(<$) :: a -> M b -> M a #

Foldable M Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

fold :: Monoid m => M m -> m #

foldMap :: Monoid m => (a -> m) -> M a -> m #

foldr :: (a -> b -> b) -> b -> M a -> b #

foldr' :: (a -> b -> b) -> b -> M a -> b #

foldl :: (b -> a -> b) -> b -> M a -> b #

foldl' :: (b -> a -> b) -> b -> M a -> b #

foldr1 :: (a -> a -> a) -> M a -> a #

foldl1 :: (a -> a -> a) -> M a -> a #

toList :: M a -> [a] #

null :: M a -> Bool #

length :: M a -> Int #

elem :: Eq a => a -> M a -> Bool #

maximum :: Ord a => M a -> a #

minimum :: Ord a => M a -> a #

sum :: Num a => M a -> a #

product :: Num a => M a -> a #

Traversable M Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

traverse :: Applicative f => (a -> f b) -> M a -> f (M b) #

sequenceA :: Applicative f => M (f a) -> f (M a) #

mapM :: Monad m => (a -> m b) -> M a -> m (M b) #

sequence :: Monad m => M (m a) -> m (M a) #

Eq a => Eq (M a) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

(==) :: M a -> M a -> Bool #

(/=) :: M a -> M a -> Bool #

Ord a => Ord (M a) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

compare :: M a -> M a -> Ordering #

(<) :: M a -> M a -> Bool #

(<=) :: M a -> M a -> Bool #

(>) :: M a -> M a -> Bool #

(>=) :: M a -> M a -> Bool #

max :: M a -> M a -> M a #

min :: M a -> M a -> M a #

Read a => Read (M a) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

readsPrec :: Int -> ReadS (M a) #

readList :: ReadS [M a] #

readPrec :: ReadPrec (M a) #

readListPrec :: ReadPrec [M a] #

Show a => Show (M a) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

showsPrec :: Int -> M a -> ShowS #

show :: M a -> String #

showList :: [M a] -> ShowS #

ToJSONMap m k v => ToJSON (M m) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

toJSON :: M m -> Value #

toEncoding :: M m -> Encoding #

toJSONList :: [M m] -> Value #

toEncodingList :: [M m] -> Encoding #

FromJSONMap m k v => FromJSON (M m) Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

parseJSON :: Value -> Parser (M m) #

parseJSONList :: Value -> Parser [M m] #

class FromJSONKey a where Source #

Instances
FromJSONKey Int Source # 
Instance details

Defined in Data.Aeson.Extra.Map

FromJSONKey Integer Source # 
Instance details

Defined in Data.Aeson.Extra.Map

FromJSONKey String Source # 
Instance details

Defined in Data.Aeson.Extra.Map

FromJSONKey Text Source # 
Instance details

Defined in Data.Aeson.Extra.Map

FromJSONKey Text Source # 
Instance details

Defined in Data.Aeson.Extra.Map

class FromJSONMap m k v | m -> k v where Source #

Instances
(Eq k, Hashable k, FromJSONKey k, FromJSON v) => FromJSONMap (HashMap k v) k v Source # 
Instance details

Defined in Data.Aeson.Extra.Map

(Ord k, FromJSONKey k, FromJSON v) => FromJSONMap (Map k v) k v Source # 
Instance details

Defined in Data.Aeson.Extra.Map

class ToJSONKey a where Source #

Methods

toJSONKey :: a -> Text Source #

Instances
ToJSONKey Int Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

toJSONKey :: Int -> Text Source #

ToJSONKey Integer Source # 
Instance details

Defined in Data.Aeson.Extra.Map

ToJSONKey String Source # 
Instance details

Defined in Data.Aeson.Extra.Map

ToJSONKey Text Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

toJSONKey :: Text -> Text Source #

ToJSONKey Text Source # 
Instance details

Defined in Data.Aeson.Extra.Map

Methods

toJSONKey :: Text -> Text0 Source #

class ToJSONMap m k v | m -> k v where Source #

Instances
(ToJSONKey k, ToJSON v) => ToJSONMap (HashMap k v) k v Source # 
Instance details

Defined in Data.Aeson.Extra.Map

(ToJSONKey k, ToJSON v) => ToJSONMap (Map k v) k v Source # 
Instance details

Defined in Data.Aeson.Extra.Map