-
Notifications
You must be signed in to change notification settings - Fork 1.2k
A single wildcard for n-ary type constructors #6374
Description
Original bug ID: 6374
Reporter: @alainfrisch
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:29:28Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.02.0
Category: typing
Tags: patch
Related to: #5528
Monitored by: @jmeber @yallop @hcarty @yakobowski
Bug 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 (#5528): 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.