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
Currently to build a Cogen for some type (A) that is isomorphic to another type (B) for which a Cogen exists, we need to summon the Cogen[B], and contramap it. This leads to noisy code like this:
It should be easy to add Cogen.resultOf that would derive a Cogen[A] given a function A => B (and the implicit Cogen[B] in scope), similarly to what Gen.resultOf does. We would then be able to write:
Currently to build a
Cogen
for some type (A
) that is isomorphic to another type (B
) for which aCogen
exists, we need to summon theCogen[B]
, andcontramap
it. This leads to noisy code like this:It should be easy to add
Cogen.resultOf
that would derive aCogen[A]
given a functionA => B
(and the implicitCogen[B]
in scope), similarly to whatGen.resultOf
does. We would then be able to write:The text was updated successfully, but these errors were encountered: