Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

online demo gives different results from what the readme says #3

Open
wizzard0 opened this issue Jun 26, 2017 · 3 comments
Open

online demo gives different results from what the readme says #3

wizzard0 opened this issue Jun 26, 2017 · 3 comments

Comments

@wizzard0
Copy link

(fun f -> (fun x -> f (fun v -> (x x) v)) (fun x -> f (fun v -> (x x) v)))
gives
((((a & a) -> (b | b)) -> ((a -> b) & c)) -> c) instead of (((v1 -> v0) -> ((v1 -> v0) & v2)) -> v2)

(fun f -> (fun x -> f (fun v -> (x x) v)) (fun x -> f (fun v -> (x x) v))) (fun f -> fun x -> f)
gives
((Top) -> ((Top) -> ((Top) -> (rec b = ((Top) -> (rec a = ((Top) -> (a | b)) | b)) | rec d = ((Top) -> (rec c = ((Top) -> (c | d)) | d))))))
instead of (Top -> rec v0 = (Top -> v0))

@stedolan
Copy link
Owner

stedolan commented Oct 3, 2017

Ah, I haven't updated the online version in a while. Both are correct, but the simplifier is not as powerful in the online version, so produces more verbose answers sometimes.

@Storyyeller
Copy link

Speaking of not updating the online version, it looks like the online version supports let rec for terms, but I don't see any support for that in the codebase. What happened? Am I missing something?

@stedolan
Copy link
Owner

def (used to define functions) still binds recursively, but I removed general let rec. Using let rec at arbitrary types is really tricky in a strict language. (See ocaml/ocaml#556 for some of the trouble this caused in OCaml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants