typed-encoding-0.3.0.2: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Common.Class.Decode

Synopsis

Documentation

class Decode f nm alg conf str where Source #

Since: 0.3.0.0

Methods

decoding :: Decoding f nm alg conf str Source #

Instances
Applicative f => Decode f "r-UTF8" "r-UTF8" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.UTF8

Methods

decoding :: Decoding f "r-UTF8" "r-UTF8" c str Source #

Applicative f => Decode f "r-Int-decimal" "r-Int-decimal" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.Misc

Methods

decoding :: Decoding f "r-Int-decimal" "r-Int-decimal" c str Source #

Applicative f => Decode f "r-Word8-decimal" "r-Word8-decimal" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.Misc

Methods

decoding :: Decoding 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 # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.BoundedAlphaNums

Methods

decoding :: Decoding f s "r-ban" c str Source #

Applicative f => Decode f "r-ASCII" "r-ASCII" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.ASCII

Methods

decoding :: Decoding f "r-ASCII" "r-ASCII" c str Source #

(UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c Text Source #

WARNING (performance)

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

decoding :: Decoding f "enc-B64" "enc-B64" c Text Source #

(UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c Text Source #

WARNING (performance)

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

decoding :: Decoding f "enc-B64" "enc-B64" c Text Source #

(UnexpectedDecodeErr f, Applicative f) => Decode f "enc-B64" "enc-B64" c ByteString Source #

Since: 0.3.0.0

Instance details

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

Instance details

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 f to allow for troubleshooting and unsafe payload changes.

Implementation simply uses implDecodingF combinator on the asUnexpected composed with decoding function.

UnexpectedDecodeErr has Identity instance allowing for decoding that assumes errors are not possible.

For debugging purposes or when unsafe changes to "my-sign" Error UnexpectedDecodeEx instance can be used.

Instance details

Defined in Examples.TypedEncoding.DiySignEncoding

Methods

decoding :: Decoding f "my-sign" "my-sign" c Text Source #

class DecodeAll f nms algs conf str where Source #

Since: 0.3.0.0

Methods

decodings :: Decodings f nms algs conf str Source #

Instances
DecodeAll f ([] :: [Symbol]) ([] :: [Symbol]) conf str Source # 
Instance details

Defined in Data.TypedEncoding.Common.Class.Decode

Methods

decodings :: Decodings f [] [] conf str Source #

(DecodeAll f nms algs conf str, Decode f nm alg conf str) => DecodeAll f (nm ': nms) (alg ': algs) conf str Source # 
Instance details

Defined in Data.TypedEncoding.Common.Class.Decode

Methods

decodings :: Decodings f (nm ': nms) (alg ': algs) conf str Source #

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

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