Last active
March 20, 2017 09:32
-
-
Save soutaro/9c163f017bb3224d819fc80d3aca1092 to your computer and use it in GitHub Desktop.
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
class ['a] rbarray = object method map : 'b . ('a -> 'b) -> 'b rbarray = Obj.magic () end;; | |
(* Error: The universal type variable 'b cannot be generalized: | |
it escapes its scope. *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recursive types in OCaml must be regular, i.e. You cannot change the type parameter.