You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It has turned out that mutable references in Bright ML is unsound. The following code is adopted from SML code in http://mlton.org/ValueRestriction and causes Bright ML crash.
val f 'a _ =
let
module R = Ref.Make {type t = option 'a}
val r = R.make None
in
fun x ->
let
val y = R.get r
val _ = R.set r $ Some x
in
match y with
| None -> x
| Some y -> y
end
val f = f ()
val _ = f 13
val _ = String.`<>` "" $ f "foo"
I had thought generative functors would rescue the interaction between polymorphism and mutable references, but that's wrong.
The text was updated successfully, but these errors were encountered:
It has turned out that mutable references in Bright ML is unsound. The following code is adopted from SML code in http://mlton.org/ValueRestriction and causes Bright ML crash.
I had thought generative functors would rescue the interaction between polymorphism and mutable references, but that's wrong.
The text was updated successfully, but these errors were encountered: