| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Linnet.Decode
Synopsis
- class Decode ct a where
- decode :: ByteString -> Either LinnetError a
- class DecodePath a where
- decodePath :: Text -> Maybe a
- class DecodeEntity a where
- decodeEntity :: Entity -> ByteString -> Either LinnetError a
Documentation
class Decode ct a where Source #
Decoding of HTTP request payload into some type a.
Phantom type ct guarantees that compiler checks support of decoding some a from content of given Content-Type
by looking for specific Decode instance.
Methods
decode :: ByteString -> Either LinnetError a Source #
Instances
| Decode TextPlain ByteString Source # | |
Defined in Linnet.Decode Methods decode :: ByteString0 -> Either LinnetError ByteString Source # | |
| Decode TextPlain ByteString Source # | |
Defined in Linnet.Decode Methods decode :: ByteString -> Either LinnetError ByteString Source # | |
class DecodePath a where Source #
Methods
decodePath :: Text -> Maybe a Source #
Instances
| DecodePath Double Source # | |
Defined in Linnet.Decode | |
| DecodePath Float Source # | |
Defined in Linnet.Decode | |
| DecodePath Int Source # | |
Defined in Linnet.Decode | |
| DecodePath Integer Source # | |
Defined in Linnet.Decode | |
| DecodePath ByteString Source # | |
Defined in Linnet.Decode Methods decodePath :: Text -> Maybe ByteString Source # | |
| DecodePath Text Source # | |
Defined in Linnet.Decode | |
class DecodeEntity a where Source #
Minimal complete definition
Nothing
Methods
decodeEntity :: Entity -> ByteString -> Either LinnetError a Source #
decodeEntity :: FromByteString a => Entity -> ByteString -> Either LinnetError a Source #
Instances
| DecodeEntity Double Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError Double Source # | |
| DecodeEntity Float Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError Float Source # | |
| DecodeEntity Int Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError Int Source # | |
| DecodeEntity Integer Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError Integer Source # | |
| DecodeEntity ByteString Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError ByteString Source # | |
| DecodeEntity Text Source # | |
Defined in Linnet.Decode Methods decodeEntity :: Entity -> ByteString -> Either LinnetError Text Source # | |