Haskell Language Free Identity ~~ (Nat,) ~~ Writer Nat


Example

Given

data Identity a = Identity a

we have

data Free Identity a
     = Pure a
     | Free (Identity (Free Identity a))

which is isomorphic to

data Deferred a
     = Now a
     | Later (Deferred a)

or equivalently (if you promise to evaluate the fst element first) (Nat, a), aka Writer Nat a, with

data Nat = Z | S Nat
data Writer Nat a = Writer Nat a