mlsub icon indicating copy to clipboard operation
mlsub copied to clipboard

online demo gives different results from what the readme says

Open wizzard0 opened this issue 7 years ago • 3 comments

(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))

wizzard0 avatar Jun 26 '17 14:06 wizzard0

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.

stedolan avatar Oct 03 '17 12:10 stedolan

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?

Storyyeller avatar Jun 09 '18 16:06 Storyyeller

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).

stedolan avatar Dec 13 '18 13:12 stedolan