Last active
January 20, 2016 20:58
-
-
Save objmagic/d78aea92c6384bb35c05 to your computer and use it in GitHub Desktop.
let-rec-and generalization happens after resolutions of all mutually recursive funtions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module S1 = struct | |
let f p sep = | |
let r = p () in | |
match r with | |
| None -> `A (sep ()) | |
| Some l -> `B l | |
end | |
module S2 = struct | |
type t = A | |
let rec p1 () = A | |
and p3 () = None | |
and f p sep = (* not fully generalized for p1, p2, p4 *) | |
let r = p () in | |
match r with | |
| None -> `A (sep ()) | |
| Some l -> `B l | |
and p4 () = | |
f p3 p1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment