Browse thread
Feature wish: to omit explicit coercion for mli's
-
Keiko Nakata
-
Oliver Bandel
- Keiko Nakata
-
Oliver Bandel
[
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: | -- (:) |
| From: | Keiko Nakata <keiko@k...> |
| Subject: | Re: [Caml-list] Feature wish: to omit explicit coercion for mli's |
From: Oliver Bandel <oliver@first.in-berlin.de> > If *.ml and *.mli do not match, then you have written > code that better would be rewritten, to say it nicely. ;-) I do not think this is a bug-wish. ob.ml would match with ob.mli by inserting explicit coercion as in : in ob.ml: let o = (object method f1 = 1 method f2 = 2 end :> < f1 : int >) in ob.mli: val o : < f1 : int > I thought that this explicit coercion can be suppressed with little inefficiency of the type checker. I occasionally use immediate objects to build polymorphic objects without writing type annotations. (I mean, if I build polymorphic objects through class definitions, I may need to define the classes with many type parameters.) For the same reason, I thought that it would be nice if I could omit explicit coercion in some cases when it does not cause inefficiency a lot. Regards, Keiko