Ticket #159 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Infix quotes have wrong precedence

Reported by: benl Owned by: erikd
Priority: blocker Milestone: 0.1.3
Component: Libraries Version: 0.1.2
Keywords: Cc:

Description

Haskell parses

sumOnetoN n = n * (n+1) `div` 2

as

sumOnetoN n = (n * (n+1)) `div` 2

but we're getting

sumOnetoN n = n * ((n+1) `div` 2)

We should do it the Haskell way.

Change History

Changed 4 years ago by erikd

  • owner set to erikd
  • status changed from new to assigned

Changed 4 years ago by erikd

  • component changed from Source Parser to Libraries

This depends on #166.

The correct way to fix this bug is is to add this

infixl 7  `quot`, `div`, `mod`

to library/Data/Int.ds.

Changed 4 years ago by erikd

  • status changed from assigned to closed
  • resolution set to fixed

Fixed.

Tue Feb 23 23:37:32 EST 2010 Erik de Castro Lopo <erikd@…>

  • Fix #159 : Infix quotes have wrong precedence.

Fix was three fold; first fix the parser to accept opname in an infix expression, then fix the exporting of opname to the interface file and finally adding an appropriate infixl statement for div to the Data.Int library module.

Note: See TracTickets for help on using tickets.