Navigation Menu

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

feature wish #2688

Closed
vicuna opened this issue Feb 22, 2001 · 2 comments
Closed

feature wish #2688

vicuna opened this issue Feb 22, 2001 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Feb 22, 2001

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

Bug description

Full_Name: Francois Pottier
Version: 3.00
OS: Linux
Submission from: oto.inria.fr (192.93.2.2)

It would be nice if the `with' construct was given a more polymorphic
type in the following situation:

$ ocaml
Objective Caml version 3.00

type 'a t = { x : 'a };;

type 'a t = { x : 'a; }

let f r z = { r with x = z };;

val f : 'a t -> 'a -> 'a t =

Here, f could receive type 'a t -> 'b -> 'b t, because x is the only
field whose type depends on the parameter 'a.

This would allow `with' to behave exactly as if it were syntactic
sugar, which is not the case currently.

@vicuna
Copy link
Author

vicuna commented Feb 23, 2001

Comment author: administrator

Full_Name: Francois Pottier
Version: 3.00

It would be nice if the `with' construct was given a more polymorphic
type in the following situation:

$ ocaml
Objective Caml version 3.00

type 'a t = { x : 'a };;

type 'a t = { x : 'a; }

let f r z = { r with x = z };;

val f : 'a t -> 'a -> 'a t =

Then you should be happy with 3.01:

    Objective Caml version 3.00+22 (2001-02-05)

type 'a t = { x : 'a };;

type 'a t = { x : 'a; }

let f r z = { r with x = z };;

val f : 'a -> 'b -> 'b t =

It's already been there for a few months.

 Jacques

@vicuna
Copy link
Author

vicuna commented Mar 5, 2001

Comment author: administrator

Wish granted in 3.01

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