typed-encoding-0.5.2.2: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Instances.Restriction.Base64

Contents

Description

'r-B64' is restricted to values that are valid Base64 encodings of some data. For example, Enc '["r-B64"] () T.Text can contain encoded binary image.

"enc-B64" can be converted to "r-B64" using flattenAs defined in Base64. However, there is no, and there should be no conversion general conversion from "r-B64" back to "enc-B64": Enc '["r-B64"] () T.Text is not B64 encoded text, it is B64 encoded something.

Since: 0.5.1.0

Synopsis

Documentation

>>> :set -XScopedTypeVariables -XKindSignatures -XMultiParamTypeClasses -XDataKinds -XPolyKinds -XPartialTypeSignatures -XFlexibleInstances -XTypeApplications

encRB64T :: Encoding (Either EncodeEx) "r-B64" "r-B64" c Text Source #

Converts text to bytestring using UTF8 decoding and then verify encoding in ByteString This is safe without verifying ASCII, any non-ASCII text will still convert to ByteString but will fail B64.decode (TODO tests would be nice)

encRB64TL :: Encoding (Either EncodeEx) "r-B64" "r-B64" c Text Source #

encRB64S :: Encoding (Either EncodeEx) "r-B64" "r-B64" c String Source #

Orphan instances

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

Methods

validation :: Validation f "r-B64" "r-B64" c String Source #

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

Encode (Either EncodeEx) "r-B64" "r-B64" c String Source # 
Instance details

Methods

encoding :: Encoding (Either EncodeEx) "r-B64" "r-B64" c String Source #

Encode (Either EncodeEx) "r-B64" "r-B64" c Text Source # 
Instance details

Methods

encoding :: Encoding (Either EncodeEx) "r-B64" "r-B64" c Text Source #

Encode (Either EncodeEx) "r-B64" "r-B64" c Text Source # 
Instance details

Methods

encoding :: Encoding (Either EncodeEx) "r-B64" "r-B64" c Text Source #

Encode (Either EncodeEx) "r-B64" "r-B64" c ByteString Source # 
Instance details

Methods

encoding :: Encoding (Either EncodeEx) "r-B64" "r-B64" c ByteString Source #

Encode (Either EncodeEx) "r-B64" "r-B64" c ByteString Source # 
Instance details

Methods

encoding :: Encoding (Either EncodeEx) "r-B64" "r-B64" c ByteString Source #