You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand the use case and how it can be expressed.
We have
caseclassCodec[I, A](eq: Equiv[I, (I, A)])
which consumes a bit of I to produce A and returns (remainder of I) + A.
We already have product operation to combine two codecs
def~ [B](that: Codec[I, B]):Codec[I, (A, B)]
which consumes a bit of I to produce A and then consumes a bit of remainder of I to produce B and returns (what is yet remained of I) + (A, B).
I've built (see the difference in that type parameters)
def>> [B](that: Codec[A, B]):Codec[I, (A, B)]
which consumes a bit of I to produce A and then consumes a bit of A to produce B and returns (the remainder of I) + (the remainder of A) + B.
Questions:
Is the use case real?
The signature is confusing, i.e. going from I to (A, B) in both cases, and I believe product is the logical assumption here. Can def >> be expressed differently?
Obviously Codec isn't a monad. Does def >> has anything to do with monadic composition?
The text was updated successfully, but these errors were encountered:
I'm trying to understand the use case and how it can be expressed.
We have
which consumes a bit of
I
to produceA
and returns (remainder ofI
) +A
.We already have product operation to combine two codecs
which consumes a bit of
I
to produceA
and then consumes a bit of remainder ofI
to produceB
and returns (what is yet remained ofI
) +(A, B)
.I've built (see the difference in
that
type parameters)which consumes a bit of
I
to produceA
and then consumes a bit ofA
to produceB
and returns (the remainder ofI
) + (the remainder ofA
) +B
.Questions:
I
to(A, B)
in both cases, and I believe product is the logical assumption here. Candef >>
be expressed differently?Codec
isn't a monad. Doesdef >>
has anything to do with monadic composition?The text was updated successfully, but these errors were encountered: