Copyright | (C) 2015-2016 Oleg Grenrus |
---|---|
License | BSD3 |
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype SingObject (s :: Symbol) a = SingObject a
- mkSingObject :: Proxy s -> a -> SingObject s a
- getSingObject :: Proxy s -> SingObject s a -> a
Documentation
newtype SingObject (s :: Symbol) a Source #
Singleton value object
λ > decode "{\"value\": 42 }" :: Maybe (SingObject "value" Int) Just (SingObject 42)
λ > encode (SingObject 42 :: SingObject "value" Int) "{\"value\":42}"
Available with: base >=4.7
Instances
mkSingObject :: Proxy s -> a -> SingObject s a Source #
getSingObject :: Proxy s -> SingObject s a -> a Source #