| Copyright | (C) 2015-2016 Oleg Grenrus |
|---|---|
| License | BSD3 |
| Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Aeson.Extra.Map
Description
- newtype M a = M {
- getMap :: a
- class FromJSONKey a where
- parseIntegralJSONKey :: Integral a => Text -> Parser a
- class FromJSONMap m k v | m -> k v where
- 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)]})class FromJSONKey a where Source #
Minimal complete definition
Methods
parseJSONKey :: Text -> Parser a Source #
Instances
class FromJSONMap m k v | m -> k v where Source #
Minimal complete definition
Instances
| (Eq k, Hashable k, FromJSONKey k, FromJSON v) => FromJSONMap (HashMap k v) k v Source # | |
| (Ord k, FromJSONKey k, FromJSON v) => FromJSONMap (Map k v) k v Source # | |