explicit promotions of prefix data constructors can't be parsed naturally
When used as an infix operator, a data constructor is explicitly promoted simply with '
prefixed, but when used as a prefix operator enclosed between (
and )
, it is explicitly promoted only with '
put before (
, not before the constructor.
On the other hand, messages of GHC and GHCi indicate that a data constructor operator in a prefix form is promoted by putting '
before the constructor! (as in forall (k :: BOX) (k :: BOX). (':*)
below.)
I believe that this is a matter of parsing. The parser should admit (':*)
as well as '(:*)
for the naturalness of the syntax.
In a GHCi:
> :set -XDataKinds -XTypeOperators
> data a :* b = a :* b
> :kind! Int :* Int
Int :* Int :: *
= Int :* Int
> :kind! Int ':* Int
Int ':* Int :: * :* *
= Int ':* Int
> :kind! (:*)
(:*) :: * -> * -> *
= (:*)
> :kind! '(:*)
'(:*) :: k -> k1 -> k :* k1
= forall (k :: BOX) (k :: BOX). (':*)
> :kind! (':*)
<interactive>:1:3: parse error on input ‘:*’