Package: hugs
Version: 98.200503.08-1

While having fun exploring the language, I discovered something
unexpected: Hugs interprets (*2+1) as as (*(2+1)), in contravention of
http://www.haskell.org/onlinereport/exps.html#sect3.5

# Syntactic precedence rules apply to sections as follows. (op e) is
# legal if and only if (x op e) parses in the same way as (x op (e));
# and similarly for (e op). For example, (*a+b) is syntactically invalid,
# but (+a*b) and (*(a+b)) are valid. Because (+) is left associative,
# (a+b+) is syntactically correct, but (+a+b) is not; the latter may
# legally be written as (+(a+b)).

A couple of examples, including specifically the one that the Report
says is syntactically invalid:

__   __ __  __  ____   ___      _________________________________________
||   || ||  || ||  || ||__      Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__||  __||     Copyright (c) 1994-2005
||---||         ___||           World Wide Web: http://haskell.org/hugs
||   ||                         Report bugs to: hugs-bugs@haskell.org
||   || Version: 20050308       _________________________________________

Haskell 98 mode: Restart with command line option -98 to enable extensions

Type :? for help
Hugs.Base> (*2+1) 6
18
Hugs.Base> let a=2; b=3 in (*a+b) 5
25


If you're going to offer the extension, I think it needs to be justified
why (*a+b) is not the same as (\x -> x*a+b)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to