Copyright | (C) 2015-2016 Oleg Grenrus |
---|---|
License | BSD3 |
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype M a = M {
- getMap :: a
- class FromJSONKey a where
- parseJSONKey :: Text -> Parser a
- parseIntegralJSONKey :: Integral a => Text -> Parser a
- class FromJSONMap m k v | m -> k v where
- parseJSONMap :: HashMap Text Value -> Parser m
- class ToJSONKey a where
- class ToJSONMap m k v | m -> k v where
Documentation
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)]})
Instances
Functor M Source # | |
Foldable M Source # | |
Defined in Data.Aeson.Extra.Map 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 # elem :: Eq a => a -> M a -> Bool # maximum :: Ord a => M a -> a # | |
Traversable M Source # | |
Eq a => Eq (M a) Source # | |
Ord a => Ord (M a) Source # | |
Read a => Read (M a) Source # | |
Show a => Show (M a) Source # | |
ToJSONMap m k v => ToJSON (M m) Source # | |
Defined in Data.Aeson.Extra.Map | |
FromJSONMap m k v => FromJSON (M m) Source # | |
class FromJSONKey a where Source #
parseJSONKey :: Text -> Parser a Source #
Instances
FromJSONKey Int Source # | |
Defined in Data.Aeson.Extra.Map | |
FromJSONKey Integer Source # | |
Defined in Data.Aeson.Extra.Map | |
FromJSONKey String Source # | |
Defined in Data.Aeson.Extra.Map | |
FromJSONKey Text Source # | |
Defined in Data.Aeson.Extra.Map | |
FromJSONKey Text Source # | |
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 # | |
Defined in Data.Aeson.Extra.Map | |
(Ord k, FromJSONKey k, FromJSON v) => FromJSONMap (Map k v) k v Source # | |
Defined in Data.Aeson.Extra.Map |