data Weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun

data WDList = NE Weekday WDList | E

NE Mon (NE Thu (NE Sat E))

Kysymys: mitä tässä tapahtuu?

case li of
  NE x y -> x
  E      -> Mon

\[ \mathbf{case}~\mathit{li}~\mathbf{of}~NE~x~y \to x \mathbin{[]} E \to Mon \mathbin{[]} \bullet \]

let f = \x -> x in f 3

\[ ( \mu f \cdot \lambda x\cdot x) 3 \]

let first = lambda l . case l of Cons x xs -> x
in first (Cons 1 Nil)

-->

( let first = lambda l . case l of Cons x xs -> x
in lambda l . case l of Cons x xs -> x )
(Cons 1 Nil)

--> 

( lambda l . case l of Cons x xs -> x )
(Cons 1 Nil)

--> 

case Cons 1 Nil of Cons x xs -> x

--> 

1

These are the current permissions for this document; please modify if needed. You can always modify these permissions from the manage page.