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