|
|
|
|
|
by AnaniasAnanas
2769 days ago
|
|
> λ calculus, with Forall and simple types Just fyi, this is called System F. I do not remember any OCaml and I get an error when trying to run it (File "./test.ml", line 123, characters 6-7: Error: Syntax error: operator expected.) so I do not know if I can be of much help. What is the result of typ_of_expr [] (app k_intint (Int 1))? I presume that you expect it to be IntTy -> IntTy, right? |
|
It is indeed system F I'm trying to implement :-)
My formatting for HN seems to have screwed the program up. You'll find the contents of systemf.ml in this paste: https://pastebin.com/gw20LBNR
Here is the result from my OCaml repl:
You are correct about what `(k_intint (Int 1))` should be. I hope for `k_intint` to be `IntTy -> IntTy -> IntTy`.