Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class EncodeF f instr outstr where
- encodeF :: instr -> f outstr
- class EncodeFAll f (xs :: [Symbol]) c str where
- encodeFAll :: Enc '[] c str -> f (Enc xs c str)
- encodeAll :: forall xs c str. EncodeFAll Identity (xs :: [Symbol]) c str => Enc '[] c str -> Enc xs c str
- encodeFPart_ :: forall f xs xsf c str. (Functor f, EncodeFAll f xs c str) => Proxy xs -> Enc xsf c str -> f (Enc (Append xs xsf) c str)
- encodeFPart :: forall (xs :: [Symbol]) xsf f c str. (Functor f, EncodeFAll f xs c str) => Enc xsf c str -> f (Enc (Append xs xsf) c str)
- encodePart_ :: EncodeFAll Identity (xs :: [Symbol]) c str => Proxy xs -> Enc xsf c str -> Enc (Append xs xsf) c str
- encodePart :: forall (xs :: [Symbol]) xsf c str. EncodeFAll Identity xs c str => Enc xsf c str -> Enc (Append xs xsf) c str
Documentation
class EncodeF f instr outstr where Source #
Instances
(HasA SizeLimit c, Applicative f) => EncodeF (f :: Type -> Type) (Enc xs c ByteString) (Enc ("do-size-limit" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Do.Sample encodeF :: Enc xs c ByteString -> f (Enc ("do-size-limit" ': xs) c ByteString) Source # | |
(HasA SizeLimit c, Applicative f) => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-size-limit" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-reverse" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-reverse" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-Title" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-Title" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-lower" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-lower" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-UPPER" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("do-UPPER" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("enc-B64" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("enc-B64" ': xs) c Text :: Type) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c ByteString) (Enc ("enc-B64" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Enc.Base64 encodeF :: Enc xs c ByteString -> f (Enc ("enc-B64" ': xs) c ByteString) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c ByteString) (Enc ("enc-B64" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Enc.Base64 encodeF :: Enc xs c ByteString -> f (Enc ("enc-B64" ': xs) c ByteString) Source # | |
Applicative f => EncodeF (f :: Type -> Type) (Enc xs c Text) (Enc ("my-sign" ': xs) c Text :: Type) Source # | Because encoding function is pure we can create instance of EncodeF
that is polymorphic in effect |
EncodeF (Either EncodeEx) (Enc xs c ByteString) (Enc ("r-UTF8" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.UTF8 encodeF :: Enc xs c ByteString -> Either EncodeEx (Enc ("r-UTF8" ': xs) c ByteString) Source # | |
EncodeF (Either EncodeEx) (Enc xs c ByteString) (Enc ("r-UTF8" ': xs) c ByteString :: Type) 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) |
Defined in Data.TypedEncoding.Instances.Restriction.UTF8 encodeF :: Enc xs c ByteString -> Either EncodeEx (Enc ("r-UTF8" ': xs) c ByteString) Source # | |
IsStringR str => EncodeF (Either EncodeEx) (Enc xs c str) (Enc ("r-Int-decimal" ': xs) c str :: Type) Source # | |
IsStringR str => EncodeF (Either EncodeEx) (Enc xs c str) (Enc ("r-Word8-decimal" ': xs) c str :: Type) Source # | |
EncodeF (Either EncodeEx) (Enc xs c ByteString) (Enc ("r-ASCII" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.ASCII encodeF :: Enc xs c ByteString -> Either EncodeEx (Enc ("r-ASCII" ': xs) c ByteString) Source # | |
EncodeF (Either EncodeEx) (Enc xs c ByteString) (Enc ("r-ASCII" ': xs) c ByteString :: Type) Source # | |
Defined in Data.TypedEncoding.Instances.Restriction.ASCII encodeF :: Enc xs c ByteString -> Either EncodeEx (Enc ("r-ASCII" ': xs) c ByteString) Source # | |
EncodeF (Either EncodeEx) (Enc xs c Text) (Enc ("r-ASCII" ': xs) c Text :: Type) Source # | |
EncodeF (Either EncodeEx) (Enc xs c Text) (Enc ("r-ASCII" ': xs) c Text :: Type) Source # | |
EncodeF (Either EncodeEx) (Enc xs c Char) (Enc ("r-ASCII" ': xs) c Char :: Type) Source # | |
class EncodeFAll f (xs :: [Symbol]) c str where Source #
encodeFAll :: Enc '[] c str -> f (Enc xs c str) Source #
Instances
Applicative f => EncodeFAll f ([] :: [Symbol]) c str Source # | |
Defined in Data.TypedEncoding.Internal.Class.Encode encodeFAll :: Enc [] c str -> f (Enc [] c str) Source # | |
(Monad f, EncodeFAll f xs c str, EncodeF f (Enc xs c str) (Enc (x ': xs) c str)) => EncodeFAll f (x ': xs) c str Source # | |
Defined in Data.TypedEncoding.Internal.Class.Encode encodeFAll :: Enc [] c str -> f (Enc (x ': xs) c str) Source # |
encodeAll :: forall xs c str. EncodeFAll Identity (xs :: [Symbol]) c str => Enc '[] c str -> Enc xs c str Source #
encodeFPart_ :: forall f xs xsf c str. (Functor f, EncodeFAll f xs c str) => Proxy xs -> Enc xsf c str -> f (Enc (Append xs xsf) c str) Source #
encodeFPart :: forall (xs :: [Symbol]) xsf f c str. (Functor f, EncodeFAll f xs c str) => Enc xsf c str -> f (Enc (Append xs xsf) c str) Source #
encodePart_ :: EncodeFAll Identity (xs :: [Symbol]) c str => Proxy xs -> Enc xsf c str -> Enc (Append xs xsf) c str Source #
encodePart :: forall (xs :: [Symbol]) xsf c str. EncodeFAll Identity xs c str => Enc xsf c str -> Enc (Append xs xsf) c str Source #
for some reason ApplyTypes syntax does not want to work if xs is specified with polymorphic [Symbol]