ADT ( - . ) (,), Either, (), (->), Void Mu
data Void --using empty data decls or
newtype Void = Void Void
Mu
newtype Mu f = Mu (f (Mu f))
,
data [a] = [] | (a:[a])
data [a] = Mu (ListF a)
data ListF a f = End | Pair a f
newtype ListF a f = ListF (Either () (a,f))
data Maybe a = Nothing | Just a
newtype Maybe a = Maybe (Either () a)
newtype ListF a f = ListF (Maybe (a,f))
mu
data List a = List (Maybe (a,List a))
data List a = List a (Maybe (List a))
- Maybe ( )
...
, . ,
hmm = List (Just undefined)
[a] = [] | (a:[a]). , Haskell . , ( ) "Lazy"
data SPair a b = SPair !a !b
data SEither a b = SLeft !a | SRight !b
data Lazy a = Lazy a --Note, this has no obvious encoding in Pure CBV languages,
--although Laza a = (() -> a) is semantically correct,
--it is strictly less efficient than Haskell CB-Need
.