| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Data.TypedEncoding.Common.Class.Decode
Description
Type classes accompanying decoding types defined in Data.TypedEncoding.Common.Types.Decoding
Examples.TypedEncoding.Instances.DiySignEncoding contains an implementation example.
Examples.TypedEncoding.Overview shows decoding usage examples.
This module is re-exported in Data.TypedEncoding and it is best not to import it directly.
Synopsis
- class Decode f nm alg conf str where
 - class DecodeAll f nms algs conf str where
 - class UnexpectedDecodeErr f where
- unexpectedDecodeErr :: UnexpectedDecodeEx -> f a
 
 - asUnexpected_ :: (KnownSymbol x, UnexpectedDecodeErr f, Applicative f, Show err) => Proxy x -> Either err a -> f a
 - asUnexpected :: forall x f err a. (KnownSymbol x, UnexpectedDecodeErr f, Applicative f, Show err) => Either err a -> f a
 
Documentation
class Decode f nm alg conf str where Source #
Since: 0.3.0.0
Instances
| Applicative f => Decode f "r-UTF8" "r-UTF8" c str Source # | |
| Applicative f => Decode f "r-Int-decimal" "r-Int-decimal" c str Source # | |
| Applicative f => Decode f "r-Word8-decimal" "r-Word8-decimal" c str Source # | |
| (KnownSymbol s, Restriction s, Algorithm s "r-ban", Applicative f) => Decode f s "r-ban" c str Source # | |
| (UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c Text Source # | Since: 0.3.0.0  | 
| (UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c Text Source # | Since: 0.3.0.0  | 
| Applicative f => Decode f "r-UNICODE.D76" "r-UNICODE.D76" c str Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.D76  | |
| Applicative f => Decode f "r-ASCII" "r-ASCII" c str Source # | |
| Applicative f => Decode f "r-B64" "r-B64" c str Source # | |
| (UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c ByteString Source # | Since: 0.3.0.0  | 
Defined in Data.TypedEncoding.Instances.Enc.Base64 Methods decoding :: Decoding f "enc-B64" "enc-B64" c ByteString Source #  | |
| (UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c ByteString Source # | Since: 0.3.0.0  | 
Defined in Data.TypedEncoding.Instances.Enc.Base64 Methods decoding :: Decoding f "enc-B64" "enc-B64" c ByteString Source #  | |
| (UnexpectedDecodeErr f, Applicative f) => Decode f "my-sign" "my-sign" c Text Source # | Decoding allows effectful  Implementation simply uses  
 For debugging purposes or when unsafe changes to "my-sign"   | 
class DecodeAll f nms algs conf str where Source #
Since: 0.3.0.0
class UnexpectedDecodeErr f where Source #
With type safety in place decoding errors should be unexpected. This class can be used to provide extra info if decoding could fail
Since: 0.1.0.0
Methods
unexpectedDecodeErr :: UnexpectedDecodeEx -> f a Source #
Instances
| UnexpectedDecodeErr Identity Source # | |
Defined in Data.TypedEncoding.Common.Class.Decode Methods unexpectedDecodeErr :: forall (a :: k). UnexpectedDecodeEx -> Identity a Source #  | |
| UnexpectedDecodeErr (Either UnexpectedDecodeEx) Source # | |
Defined in Data.TypedEncoding.Common.Class.Decode Methods unexpectedDecodeErr :: forall (a :: k). UnexpectedDecodeEx -> Either UnexpectedDecodeEx a Source #  | |
asUnexpected_ :: (KnownSymbol x, UnexpectedDecodeErr f, Applicative f, Show err) => Proxy x -> Either err a -> f a Source #
Since: 0.1.0.0
asUnexpected :: forall x f err a. (KnownSymbol x, UnexpectedDecodeErr f, Applicative f, Show err) => Either err a -> f a Source #
Since: 0.1.0.0