Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marc Herbert #3570

Closed
vicuna opened this issue Mar 31, 2005 · 0 comments
Closed

Marc Herbert #3570

vicuna opened this issue Mar 31, 2005 · 0 comments

Comments

@vicuna
Copy link

vicuna commented Mar 31, 2005

Original bug ID: 3570
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: implicit polymorphic methods
Version: 3.08.2
OS: linux
Submission from: lns-vlq-25-ren-82-255-137-244.adsl.proxad.net (82.255.137.244)

This is a small suggestion for the reference manual.

http://caml.inria.fr/pub/docs/manual-ocaml/manual005.html#ss:polymorphic-methods
Section 3.11

"polymorphic method types must be fully explicit in class definitions".

This is surprising because:

  • function types can almost always stay implicit (this is one of the great
    features of ocaml)
  • in the example given, if one omits the type for the method "fold", the error
    message gives the exact missing type! If ocaml is so clever as to guess the
    missing type (just like it brightly does for functions) then why does the
    programmer have to state it explicitly?

I think adding just a couple of lines trying to clarify this explicit method
type mystery in section 3.11 would make the manual easier to read.

This could be:

  • a counter-example where the error message does not show that ocaml is able to
    infer the method type by itself
  • a very short description of the reason that prevents method types from being
    implicit, with a reference to further information
  • anything else that makes this mystery look like a motivated choice as opposed
    to a weird, "un-natural" design decision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant