I think June 98 Hugs incorrectly refuses to parse some right sections.  For
instance:

IB> (+ sin 3)
ERROR: Syntax error in expression (unexpected numeric literal)
IB> (+ (sin 3))
<<function>>

Left sections fare better:

{{Gc:1911951}}IB> ((sin 3) +)
<<function>>
{{Gc:1911952}}IB> (sin 3 +)
<<function>>

Here's a quote from Section 3.5 ("Sections") of the Haskell 98 report:

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)).

- Conal

Reply via email to