On 8/23/06, Brian Hulley <brianh@metamilk.com> wrote:
Hi -
Disregarding my last proposal which involved the use of {} in types, I am
wondering if anyone would agree with me that it would be a good idea to use
{} instead of () when writing out the context ie:
foo :: (Num a, Bar a) => a -> a
would become:
foo :: {Num a, Bar a} => a -> a
and the same for every other situation in the language where a context
appears.
My reasons are twofold:
1) The context is supposed to be understood (afaiu) as a *set* of
constraints not a *tuple* of constraints (ie what relevance does the
ordering implied by the tuple notation have here?), so the using of set
braces seems mathematically more appropriate
2) It would allow an editor to give the correct fontification for an
incomplete type expression. At the moment, if you'd just typed:
foo :: (Bar
the editor would have no way of knowing if "Bar" is a classcon or a tycon,
whereas with:
foo :: {Bar
the opening brace immediately informs the editor that the following text
should be parsed as a context and so it could fontify Bar appropriately.