Free Maybe MaybeT(作家 Nat)
特定
data Maybe a = Just a
| Nothing
我們有
data Free Maybe a
= Pure a
| Free (Just (Free Maybe a))
| Free Nothing
這相當於
data Hopes a
= Confirmed a
| Possible (Hopes a)
| Failed
或等效(如果你承諾首先評估 fst 元素)(Nat, Maybe a)
,aka MaybeT (Writer Nat) a
with
data Nat = Z | S Nat
data Writer Nat a = Writer Nat a
data MaybeT (Writer Nat) a = MaybeT (Nat, Maybe a)