Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Documentation
class Encode f nm alg conf str where Source #
Using 2 Symbol type variables (nm
and alg
) creates what seems like redundant typing
in statically defined instances such as "r-ASCII"
, however it
provides future flexibility to
constrain nm
in some interesting way, different than AlgNm nm ~ alg
.
It also seems to be easier to understand as type variables used in the definition of Encoding
match with what is on the typeclass.
alg
is expected to be very statically defined and is needed to support more open instances such as "r-ban"
.
Since: 0.3.0.0
Instances
(HasA SizeLimit c, Applicative f) => Encode f "do-size-limit" "do-size-limit" c ByteString Source # | |
Defined in Data.TypedEncoding.Instances.Do.Sample encoding :: Encoding f "do-size-limit" "do-size-limit" c ByteString Source # | |
(HasA SizeLimit c, Applicative f) => Encode f "do-size-limit" "do-size-limit" c Text Source # | |
Applicative f => Encode f "do-reverse" "do-reverse" c Text Source # | |
Applicative f => Encode f "do-reverse" "do-reverse" c Text Source # | |
Applicative f => Encode f "do-Title" "do-Title" c Text Source # | |
Applicative f => Encode f "do-Title" "do-Title" c Text Source # | |
Applicative f => Encode f "do-lower" "do-lower" c Text Source # | |
Applicative f => Encode f "do-lower" "do-lower" c Text Source # | |
Applicative f => Encode f "do-UPPER" "do-UPPER" c Text Source # | |
Applicative f => Encode f "do-UPPER" "do-UPPER" c Text Source # | |
Applicative f => Encode f "enc-B64" "enc-B64" c Text Source # | This instance will likely be removed in future versions (performance concerns) |
Applicative f => Encode f "enc-B64" "enc-B64" c ByteString Source # | |
Defined in Data.TypedEncoding.Instances.Enc.Base64 encoding :: Encoding f "enc-B64" "enc-B64" c ByteString Source # | |
Applicative f => Encode f "enc-B64" "enc-B64" c ByteString Source # | |
Defined in Data.TypedEncoding.Instances.Enc.Base64 encoding :: Encoding f "enc-B64" "enc-B64" c ByteString Source # | |
Applicative f => Encode f "my-sign" "my-sign" c Text Source # | Because encoding function is pure we can create instance of EncodeF
that is polymorphic in effect |
(Ban s, Algorithm s "r-ban", IsStringR str) => Encode (Either EncodeEx) s "r-ban" c str Source # | |
Char8Find str => Encode (Either EncodeEx) "r-ASCII" "r-ASCII" c str Source # | |
Encode (Either EncodeEx) "r-ASCII" "r-ASCII" c Char Source # | |
IsStringR str => Encode (Either EncodeEx) "r-Int-decimal" "r-Int-decimal" c str Source # | |
Encode (Either EncodeEx) "r-UTF8" "r-UTF8" c ByteString Source # | |
Encode (Either EncodeEx) "r-UTF8" "r-UTF8" c ByteString Source # | UTF8 encodings are defined for ByteString only as that would not make much sense for Text
Following test uses \(b :: B.ByteString) -> verEncoding b (fmap (fromEncoding . decodeAll . proxiedId (Proxy :: Proxy (Enc '["r-UTF8"] _ _))) . (encodeFAll :: _ -> Either EncodeEx _). toEncoding () $ b) |
IsStringR str => Encode (Either EncodeEx) "r-Word8-decimal" "r-Word8-decimal" c str Source # | |
class EncodeAll f nms algs conf str where Source #
Since: 0.3.0.0