Module
Data.Codec
- Package
- purescript-codec
- Repository
- garyb/purescript-codec
#GCodec Source
data GCodec m n a b
A general type for codecs.
Constructors
Instances
(Functor m, Functor n) => Functor (GCodec m n a)
(Functor m, Functor n) => Invariant (GCodec m n a)
(Apply m, Apply n) => Apply (GCodec m n a)
(Applicative m, Applicative n) => Applicative (GCodec m n a)
(Bind m, Bind n) => Bind (GCodec m n a)
(Monad m, Monad n) => Monad (GCodec m n a)
(Functor m, Functor n) => Profunctor (GCodec m n)
(Alt m, Alt n) => Alt (GCodec m n a)
(Plus m, Plus n) => Plus (GCodec m n a)
(Alternative m, Alternative n) => Alternative (GCodec m n a)
(MonadZero m, MonadZero n) => MonadZero (GCodec m n a)
(MonadPlus m, MonadPlus n) => MonadPlus (GCodec m n a)
(Bind n) => Semigroupoid (GCodec m n)
#bihoistGCodec Source
bihoistGCodec :: forall b a n' n m' m. (m ~> m') -> (n ~> n') -> GCodec m n a b -> GCodec m' n' a b
Changes the m
and n
functors used in the codec using the specified
natural transformations.
#(~) Source
Operator alias for Data.Profunctor.lcmap (left-associative / precedence 5)
GCodec
is defined as a Profunctor
so that lmap
can be used to target
specific fields when defining a codec for a product type. This operator
is a convenience for that:
tupleCodec =
Tuple
<$> fst ~ fstCodec
<*> snd ~ sndCodec
#composeCodec Source
composeCodec :: forall m c e b f d a. Bind m => Codec m d c e f -> Codec m a b c d -> Codec m a b e f
#composeCodecFlipped Source
composeCodecFlipped :: forall m c e b f d a. Bind m => Codec m a b c d -> Codec m d c e f -> Codec m a b e f
#hoistCodec Source
hoistCodec :: forall d c b a m' m. (m ~> m') -> Codec m a b c d -> Codec m' a b c d
#BasicCodec Source
type BasicCodec m a b = Codec m a a b b
#basicCodec Source
basicCodec :: forall b a m. (a -> m b) -> (b -> a) -> BasicCodec m a b
- Modules
- Data.
Codec