|Anonymous | Login | Signup for a new account||2014-10-02 02:29 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006374||OCaml||OCaml typing||public||2014-04-18 15:44||2014-09-25 17:57|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0006374: A single wildcard for n-ary type constructors|
|Description||I propose to accept the type expression "_ t" when "t" is a type constructor with more than one argument. This makes it easier, for instance, to write:|
("%s" : _ format)
and this is very coherent with the behavior of patterns on n-ary constructors.
I attach a trivial patch.
A further motivation is for the work on inlined records (0005528): the implicit inner record types are given type variables derived from the free variables in the record definition. It's better if one can add a type annotation on those t.A record types without having to care about their exact arity.
I'll commit this patch in a few days unless someone objects to it.
|Attached Files||patch_nary_wildcard.diff [^] (669 bytes) 2014-04-18 15:44 [Show Content]|
I understand your point, and there is a good argument that it matches the use of wildcards in pattern matching.
However, this is an important change, and I think it should be discussed on the developer's list.
|This was committed by mistake in commit 14659 (which means it went out in 4.02, sorry!). Since then, this was discussed on caml-devel, there was some positive feedback and no opposition, and so I'll leave it there.|
|2014-04-18 15:44||frisch||New Issue|
|2014-04-18 15:44||frisch||File Added: patch_nary_wildcard.diff|
|2014-04-18 16:05||frisch||Description Updated||View Revisions|
|2014-04-18 16:08||frisch||Description Updated||View Revisions|
|2014-04-18 16:08||frisch||Assigned To||=> frisch|
|2014-04-18 16:08||frisch||Status||new => assigned|
|2014-04-18 16:08||frisch||Target Version||=> 4.02.0+dev|
|2014-04-18 16:11||frisch||Relationship added||related to 0005528|
|2014-04-20 04:04||garrigue||Note Added: 0011308|
|2014-08-21 12:01||doligez||Tag Attached: patch|
|2014-08-21 12:01||doligez||Target Version||4.02.0+dev =>|
|2014-09-25 17:57||frisch||Note Added: 0012205|
|Copyright © 2000 - 2011 MantisBT Group|