Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006374OCamltypingpublic2014-04-18 15:442015-12-11 19:29
Assigned Tofrisch 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.02.0 
Summary0006374: A single wildcard for n-ary type constructors
DescriptionI 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 Filesdiff file icon patch_nary_wildcard.diff [^] (669 bytes) 2014-04-18 15:44 [Show Content]

- Relationships
related to 0005528closedfrisch Inline records for constructor arguments 

-  Notes
garrigue (manager)
2014-04-20 04:04

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.
frisch (developer)
2014-09-25 17:57

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.

- Issue History
Date Modified Username Field Change
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
2014-10-02 18:11 frisch Status assigned => resolved
2014-10-02 18:11 frisch Fixed in Version => 4.02.0
2014-10-02 18:11 frisch Resolution open => fixed
2015-12-11 19:29 xleroy Status resolved => closed
2017-02-23 16:45 doligez Category OCaml typing => typing

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker