I believe this is a bug in Hugs, not a liberality of GHC. The Haskell 98 report (appropriate in the context of Hugs usage) says
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))
.
I interpret that as allowing (10 * ac + )
since both (*)
and (+)
are left associative, and indeed (*)
has higher precedence.
As pointed out in the comments, ((10 * ac) + )
is accepted by both, so is a workaround.
Interestingly, this isn't listed in the Hugs vs Haskell 98 page, so maybe Mark P. Jones reads this section of the report differently to me. Certainly I can forgive him for this; Gofer implemented constructor classes long before Haskell allowed them, and Hugs is still faster than GHCi at compilation, and still gives better error messages.