aeson-decode-0.1.0.0: Easy functions for converting from Aeson.Value

Safe HaskellNone
LanguageHaskell2010

AesonDecode

Contents

Synopsis

Decoder

newtype Decoder a Source #

Constructors

Decoder 

Fields

Instances

Monad Decoder Source # 

Methods

(>>=) :: Decoder a -> (a -> Decoder b) -> Decoder b #

(>>) :: Decoder a -> Decoder b -> Decoder b #

return :: a -> Decoder a #

fail :: String -> Decoder a #

Functor Decoder Source # 

Methods

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

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

Applicative Decoder Source # 

Methods

pure :: a -> Decoder a #

(<*>) :: Decoder (a -> b) -> Decoder a -> Decoder b #

liftA2 :: (a -> b -> c) -> Decoder a -> Decoder b -> Decoder c #

(*>) :: Decoder a -> Decoder b -> Decoder b #

(<*) :: Decoder a -> Decoder b -> Decoder a #

Alternative Decoder Source # 

Methods

empty :: Decoder a #

(<|>) :: Decoder a -> Decoder a -> Decoder a #

some :: Decoder a -> Decoder [a] #

many :: Decoder a -> Decoder [a] #

FromJSON a => Default (Decoder a) Source # 

Methods

def :: Decoder a #

is :: (Eq a, FromJSON a) => a -> Decoder () Source #

is x produces Just () if the JSON value decodes to x, or Nothing otherwise.

Path

newtype Path Source #

Constructors

Path 

Fields

Instances

here :: Path Source #

The empty path.

at :: Path -> Decoder a -> Decoder a Source #

only :: Path Source #

Selects the only element from an array of length 1.

Text

text :: Decoder Text Source #

Decodes a JSON string as Text.

textIs :: Text -> Decoder () Source #

is x produces Just () if the JSON value is the string x, or Nothing otherwise.

Integer

integer :: Decoder Integer Source #

Decodes a JSON number as an Integer.

integerIs :: Integer -> Decoder () Source #

is x produces Just () if the JSON value is the integer x, or Nothing otherwise.

Boolean

bool :: Decoder Bool Source #

Decodes a JSON boolean as a Bool.

boolIs :: Bool -> Decoder () Source #

is x produces Just () if the JSON value is the boolean x, or Nothing otherwise.

true :: Decoder () Source #

is x produces Just () if the JSON value is the value true, or Nothing otherwise.

false :: Decoder () Source #

is x produces Just () if the JSON value is the value false, or Nothing otherwise.

List

Vector

Ord map

Hash map

Null

null :: Decoder () Source #

is x produces Just () if the JSON value is the value null, or Nothing otherwise.