blog-static/code/compiler/13/examples/pair.txt

18 lines
249 B
Plaintext
Raw Permalink Normal View History

2020-09-08 18:38:05 -07:00
data Pair a b = { MkPair a b }
defn fst p = {
case p of {
MkPair a b -> { a }
}
}
defn snd p = {
case p of {
MkPair a b -> { b }
}
}
defn pair = { MkPair 1 (MkPair 2 3) }
defn main = { fst pair + snd (snd pair) }