[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2009-12-20 (17:44) |
From: | Jacques Le Normand <rathereasy@g...> |
Subject: | obj.magic for polymorphic record fields |
Dear ocaml-list, the following code does not type check: type foo = {bar : 'a. 'a -> 'a} let a : int -> int = fun x -> x let baz = {bar = Obj.magic a} with the error Error: This field value has type 'a -> 'a which is less general than 'b. 'b -> 'b my question is: how could I use obj.magic to get a polymorphic type? Jacques