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

FAQ suggestion: explain the interaction between (relaxed) value restriction and variance annotations #5607

Closed
vicuna opened this issue May 6, 2012 · 5 comments

Comments

@vicuna
Copy link

vicuna commented May 6, 2012

Original bug ID: 5607
Reporter: @gasche
Assigned to: @Octachron
Status: resolved (set by @Octachron on 2017-10-16T06:56:25Z)
Resolution: fixed
Priority: normal
Severity: feature
Target version: 4.07.0+dev/beta2/rc1/rc2
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: documentation
Tags: manual
Related to: #6225
Monitored by: @hcarty

Bug description

Users, even familiar with the language, mostly do not not about variance annotations, and in particular their interaction with the relaxed value restriction. The problem they observe is that expressions at an abstract type representing a polymorphic data structure do not get generalized as expected.

I think that would be a good addition in the FAQ, in the spirit of "A function obtained through partial application is not polymorphic enough".

Additional information

This problem has been discussed twice recently:

My reddit message might be a good basis for a FAQ answer; I hope to receive additional feedback on which wording would be best.

@vicuna
Copy link
Author

vicuna commented Jul 21, 2015

Comment author: @Octachron

On this matter, I think that the relaxed value restriction and weakly polymorphic type should absolutely be described in the reference manual. It makes very little sense that the manual currently does not even mention the value restriction.

@vicuna
Copy link
Author

vicuna commented Jul 21, 2015

Comment author: @gasche

I agree, and would be delighted to give feedback to and eventually merge a pull request:

https://github.com/ocaml/ocaml-manual

@vicuna
Copy link
Author

vicuna commented Apr 14, 2016

Comment author: @damiendoligez

The manual is now in the manual/ subdirectory of http://github.com/ocaml/ocaml

@vicuna
Copy link
Author

vicuna commented Feb 24, 2017

Comment author: @Octachron

The new manual chapter proposed in #594 explicits this reliationship.

@vicuna
Copy link
Author

vicuna commented Oct 16, 2017

Comment author: @Octachron

Fixed by merging the PR above in 4.06 .

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

2 participants