Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype Decoder a = Decoder {
- decodeMaybe :: Value -> Maybe a
- constDecoder :: Maybe a -> Decoder a
- constSuccessDecoder :: a -> Decoder a
- failDecoder :: Decoder a
- mapDecoder :: (a -> b) -> Decoder a -> Decoder b
- apDecoder :: Decoder (a -> b) -> Decoder a -> Decoder b
- composeDecoderFunctions :: (b -> Decoder c) -> (a -> Decoder b) -> a -> Decoder c
- orElse :: Decoder a -> Decoder a -> Decoder a
- defaultDecoder :: FromJSON a => Decoder a
- is :: (Eq a, FromJSON a) => a -> Decoder ()
- (^?) :: Value -> Decoder a -> Maybe a
- newtype Path = Path {}
- here :: Path
- stringPath :: String -> Path
- textPath :: Text -> Path
- at :: Path -> Decoder a -> Decoder a
- only :: Path
- text :: Decoder Text
- textIs :: Text -> Decoder ()
- integer :: Decoder Integer
- integerIs :: Integer -> Decoder ()
- bool :: Decoder Bool
- boolIs :: Bool -> Decoder ()
- true :: Decoder ()
- false :: Decoder ()
- listOf :: Decoder a -> Decoder [a]
- vectorOf :: Decoder a -> Decoder (Vector a)
- ordMapOf :: Decoder a -> Decoder (Map Text a)
- hashMapOf :: Decoder a -> Decoder (HashMap Text a)
- null :: Decoder ()
- nullable :: Decoder a -> Decoder (Maybe a)
Decoder
Some way of interpreting a JSON value, with the possibility of failure for some values
Decoder | |
|
Instances
Alternative Decoder Source # |
|
Applicative Decoder Source # | |
Functor Decoder Source # |
|
Monad Decoder Source # |
|
FromJSON a => Default (Decoder a) Source # |
|
Defined in AesonDecode |
:: Maybe a | The result that the decoder always produces |
-> Decoder a | A decoder that always produces the given result |
Always produces the same result
constSuccessDecoder :: a -> Decoder a Source #
Always succeeds and produces the same result
failDecoder :: Decoder a Source #
Always fails
This is the identity of the Alternative
for Decoder
.
mapDecoder :: (a -> b) -> Decoder a -> Decoder b Source #
composeDecoderFunctions :: (b -> Decoder c) -> (a -> Decoder b) -> a -> Decoder c Source #
Compose two decoder-producing functions
defaultDecoder :: FromJSON a => Decoder a Source #
Path
stringPath :: String -> Path Source #