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)