Changes between Version 9 and Version 10 of InfixTypeConstructors


Ignore:
Timestamp:
Nov 24, 2010 9:34:45 PM (3 years ago)
Author:
iavor.diatchki@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InfixTypeConstructors

    v9 v10  
    6666}}} 
    6767 
     68== Issues == 
     69 
     70The second proposal---to treat all infix operators as type constructors---leads to an ambiguity in import/export declarations: 
     71{{{ 
     72module Test ( (+) ) where 
     73}}} 
     74 
     75This export declaration is ambiguous because it is not clear if we mean to export the value operator (+), the type constructor (+), or both. 
     76A similar issue arises with imports. 
     77 
     78One possible solution is to state that, when written on their own, infix operators in import/export specifications refer to the value level. 
     79So in the above example we would be exporting the value operator (+). 
     80 
     81To import/export the type constructor one would have to use an explicit (possibly empty) sub-ordinate list: 
     82{{{ 
     83module Test ( (+)() ) where 
     84}}} 
     85 
     86Unfortunately, such specifications look rather odd. 
     87 
     88Another solution would be to introduce a new piece of syntax which would translate to the same thing.  Perhaps: 
     89{{{ 
     90module Test ( type (+) ) where 
     91}}} 
     92The intention here is that `type` specifies the namespace of the following name, and not that it is a type synonym. 
     93 
     94 
     95 
    6896== References == 
    6997