[Hugs] #39: Incorrect parsing of lambda expressions
#39: Incorrect parsing of lambda expressions -----------------------------+---------------------------------------------- Reporter: Ørjan Johansen | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Component: parsing | Version: 200609 Keywords: | -----------------------------+---------------------------------------------- Hugs doesn't seem to allow lambda expressions everywhere it should. Example: Hugs> let f l = flip map l \a -> a+1 in f [1..10] ERROR - Syntax error in expression (unexpected backslash (lambda)) -- Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/39> Hugs <http://www.haskell.org/hugs/> Hugs 98, an interpreter for Haskell
#39: Incorrect parsing of lambda expressions ------------------------------+--------------------------------------------- Reporter: Ørjan Johansen | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Component: parsing | Version: 200609 Resolution: | Keywords: ------------------------------+--------------------------------------------- Comment (by Neil Mitchell): Using GHCi Prelude> let f l = flip map l \a -> a+1 in f [1..10] <interactive>:1:21: parse error on input `\' Can you point to a Haskell thingy that gets this "right", or a section of the report that shows the above being correct? -- Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/39> Hugs <http://www.haskell.org/hugs/> Hugs 98, an interpreter for Haskell
[I couldn't resist...sorry ;-) ] The bug reporter may feel the Haskell grammar "succs" here, so perhaps he'd be content rephrasing it as let f l = flip map l succ in f [1..10] instead? --sigbjorn Hugs wrote:
#39: Incorrect parsing of lambda expressions ------------------------------+--------------------------------------------- Reporter: Ørjan Johansen | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Component: parsing | Version: 200609 Resolution: | Keywords: ------------------------------+--------------------------------------------- Comment (by Neil Mitchell):
Using GHCi
Prelude> let f l = flip map l \a -> a+1 in f [1..10] <interactive>:1:21: parse error on input `\'
Can you point to a Haskell thingy that gets this "right", or a section of the report that shows the above being correct?
#39: Incorrect parsing of lambda expressions ------------------------------+--------------------------------------------- Reporter: Ørjan Johansen | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Component: parsing | Version: 200609 Resolution: | Keywords: ------------------------------+--------------------------------------------- Comment (by Ørjan Johansen): What, you are right, the argument of a function is an aexp, while lambdas are exp^10^s. It just seemed so natural that I assumed it was allowed: for example, without it continuation passing style gets more awkward. Well, now that I understand why it happens, I see that I can get around it with a $. -- Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/39> Hugs <http://www.haskell.org/hugs/> Hugs 98, an interpreter for Haskell
#39: Incorrect parsing of lambda expressions ------------------------------+--------------------------------------------- Reporter: Ørjan Johansen | Owner: nobody Type: defect | Status: closed Priority: major | Milestone: Component: parsing | Version: 200609 Resolution: invalid | Keywords: ------------------------------+--------------------------------------------- Changes (by guest): * resolution: => invalid * status: new => closed -- Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/39> Hugs <http://www.haskell.org/hugs/> Hugs 98, an interpreter for Haskell
participants (2)
-
Hugs -
Sigbjorn Finne