[clean-list] Funny identifiers starting with double colon
John van Groningen
johnvg at cs.ru.nl
Mon Nov 1 15:07:34 MET 2010
Hi Vag,
You wrote:
>Compiler eats
>
>:: A = ::: | .:: | ?:: | ::? | :::!!! | | :::.
>
>but complains on each
>
>:: A = ::!
>:: A = !::
>:: A = ::.
>
>i.e. every identifier starting with ! or with :: (excluding :::) considered incorrect.
>
>Is this intended behavior?
Yes, except for ::A = !::
::! , ::. and ::* are parsed as :: followed by !, . or *.
This makes it possible to write:
f ::!Int -> Int
f ::.Int -> Int
f ::*Int -> Int
Other symbols starting with :: are allowed, for example ::?
Type names may not start with a !, because ! is used as strictness annotation.
The type definition:
:: A = !::
is correct, and is allowed by the current development version of the compiler.
However,
:: A :== :!!
is incorrect.
Kind regards,
John van Groningen
More information about the clean-list
mailing list