[Haskell-cafe] Identity operator for types

ALeX Kazik alex at kazik.de
Fri May 17 09:56:17 UTC 2019


Hi Juan,

> Now, the problem is what can I do to have a type that contains a
> single Int? Is there a sort of id for types so that I can write

Identity is the solution

f :: Example Identity Int -> Int
f (Example i) = 2 * runIdentity i

Alex.


More information about the Haskell-Cafe mailing list