Code for the compiler described in my blog
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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) }
|
|
|