typed-encoding-0.4.2.0: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Instances.Support.Encode

Contents

Description

v0.2 style encoding combinators

Since: 0.3.0.0

Synopsis

Documentation

_implEncFromString :: forall nm err a c str. (KnownSymbol nm, Show err) => (Enc '[nm] () str -> Either err a) -> Encoding (Either EncodeEx) nm (AlgNm nm) c str Source #

Create "r-" - like encoding based on fromEncF like function.

Useful for small not performance critical encoding since it executed provided fromEnc function to verify the encoding

this method does not restrict nm to follow "r-" naming convention but is expected to be used to define "r-" encoding.

Compiler figures out algorithm, these appear fast enough

_implEncodingP :: forall nm f c str. Applicative f => (str -> str) -> Encoding f nm (AlgNm nm) c str Source #

_implEncodingConfP :: forall nm f c str. Applicative f => (c -> str -> str) -> Encoding f nm (AlgNm nm) c str Source #

_implEncodingEx :: forall nm err c str. (KnownSymbol nm, Show err) => (str -> Either err str) -> Encoding (Either EncodeEx) nm (AlgNm nm) c str Source #

_implEncodingEncodeEx :: forall nm c str. KnownSymbol nm => (str -> Either EncodeEx str) -> Encoding (Either EncodeEx) nm (AlgNm nm) c str Source #

_implEncodingConfEx :: forall nm err c str. (KnownSymbol nm, Show err) => (c -> str -> Either err str) -> Encoding (Either EncodeEx) nm (AlgNm nm) c str Source #

Assume alg ~ nm or explicit alg

implEncodingP :: forall nm f c str. Applicative f => (str -> str) -> Encoding f nm nm c str Source #

implEncodingEx :: forall nm err c str. (KnownSymbol nm, Show err) => (str -> Either err str) -> Encoding (Either EncodeEx) nm nm c str Source #

implEncodingEx' :: forall alg nm err c str. (KnownSymbol nm, Show err) => (str -> Either err str) -> Encoding (Either EncodeEx) nm alg c str Source #

implEncodingEncodeEx' :: forall alg nm c str. KnownSymbol nm => (str -> Either EncodeEx str) -> Encoding (Either EncodeEx) nm alg c str Source #