Copyright | (C) 2015-2016 Oleg Grenrus |
---|---|
License | BSD3 |
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
- 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)]})
class FromJSONKey a where Source
parseJSONKey :: Text -> Parser a Source
parseIntegralJSONKey :: Integral a => Text -> Parser a Source
class FromJSONMap m k v | m -> k v where Source
(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 |