typed-encoding-0.4.2.0: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Common.Class.Validate

Synopsis

Documentation

class Validate f nm alg conf str where Source #

Methods

validation :: Validation f nm alg conf str Source #

Instances
(RecreateErr f, Applicative f) => Validate f "r-UTF8" "r-UTF8" c ByteString Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.UTF8

Methods

validation :: Validation f "r-UTF8" "r-UTF8" c ByteString Source #

(RecreateErr f, Applicative f) => Validate f "r-UTF8" "r-UTF8" c ByteString Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.UTF8

Methods

validation :: Validation f "r-UTF8" "r-UTF8" c ByteString Source #

(KnownSymbol s, Ban s, Algorithm s "r-ban", IsStringR str, RecreateErr f, Applicative f) => Validate f s "r-ban" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.BoundedAlphaNums

Methods

validation :: Validation f s "r-ban" c str Source #

(RecreateErr f, Applicative f) => Validate f "do-UPPER" "do-UPPER" c Text Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Do.Sample

Methods

validation :: Validation f "do-UPPER" "do-UPPER" c Text Source #

(RecreateErr f, Applicative f) => Validate f "r-UNICODE.D76" "r-UNICODE.D76" () String Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.D76

Methods

validation :: Validation f "r-UNICODE.D76" "r-UNICODE.D76" () String Source #

(RecreateErr f, Applicative f) => Validate f "r-ByteRep" "r-ByteRep" () String Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.ByteRep

Methods

validation :: Validation f "r-ByteRep" "r-ByteRep" () String Source #

(RecreateErr f, Applicative f) => Validate f "r-ByteRep" "r-ByteRep" () ByteString Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.ByteRep

Methods

validation :: Validation f "r-ByteRep" "r-ByteRep" () ByteString Source #

(RecreateErr f, Applicative f) => Validate f "r-ByteRep" "r-ByteRep" () ByteString Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.ByteRep

Methods

validation :: Validation f "r-ByteRep" "r-ByteRep" () ByteString Source #

(Char8Find str, RecreateErr f, Applicative f) => Validate f "r-ASCII" "r-ASCII" () str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.ASCII

Methods

validation :: Validation f "r-ASCII" "r-ASCII" () str Source #

Applicative f => Validate f "enc-B64-len" "enc-B64-len" c ByteString Source #

Lenient decoding does not fail

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64-len" "enc-B64-len" c ByteString Source #

Applicative f => Validate f "enc-B64-len" "enc-B64-len" c ByteString Source #

Lenient decoding does not fail

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64-len" "enc-B64-len" c ByteString Source #

(RecreateErr f, Applicative f) => Validate f "enc-B64" "enc-B64" c Text Source #

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64" "enc-B64" c Text Source #

(RecreateErr f, Applicative f) => Validate f "enc-B64" "enc-B64" c Text Source #

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64" "enc-B64" c Text Source #

(RecreateErr f, Applicative f) => Validate f "enc-B64" "enc-B64" c ByteString Source #

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64" "enc-B64" c ByteString Source #

(RecreateErr f, Applicative f) => Validate f "enc-B64" "enc-B64" c ByteString Source #

Since: 0.3.0.0

Instance details

Defined in Data.TypedEncoding.Instances.Enc.Base64

Methods

validation :: Validation f "enc-B64" "enc-B64" c ByteString Source #

(RecreateErr f, Applicative f) => Validate f "my-sign" "my-sign" c Text Source #

Recreation allows effectful f to check for tampering with data.

Implementation simply uses validFromDec combinator on the recovery function.

Instance details

Defined in Examples.TypedEncoding.DiySignEncoding

Methods

validation :: Validation f "my-sign" "my-sign" c Text Source #

IsStringR str => Validate (Either RecreateEx) "r-Int-decimal" "r-Int-decimal" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.Misc

Methods

validation :: Validation (Either RecreateEx) "r-Int-decimal" "r-Int-decimal" c str Source #

IsStringR str => Validate (Either RecreateEx) "r-Word8-decimal" "r-Word8-decimal" c str Source # 
Instance details

Defined in Data.TypedEncoding.Instances.Restriction.Misc

Methods

validation :: Validation (Either RecreateEx) "r-Word8-decimal" "r-Word8-decimal" c str Source #

class ValidateAll f nms algs conf str where Source #

Methods

validations :: Validations f nms algs conf str Source #

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

Defined in Data.TypedEncoding.Common.Class.Validate

Methods

validations :: Validations f [] [] conf str Source #

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

Defined in Data.TypedEncoding.Common.Class.Validate

Methods

validations :: Validations f (nm ': nms) (alg ': algs) conf str Source #

class RecreateErr f where Source #

Recovery errors are expected unless Recovery allows Identity instance

Since: 0.1.0.0

Methods

recoveryErr :: RecreateEx -> f a Source #

asRecreateErr_ :: (RecreateErr f, Applicative f, Show err, KnownSymbol x) => Proxy x -> Either err a -> f a Source #

Since: 0.2.1.0

asRecreateErr :: forall x f err a. (RecreateErr f, Applicative f, Show err, KnownSymbol x) => Either err a -> f a Source #

Since: 0.1.0.0