Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#159 closed defect (fixed)

Infix quotes have wrong precedence

Reported by: benl Owned by: erikd
Priority: blocker Milestone:
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 (4)

comment:1 Changed 9 years ago by erikd

  • Owner set to erikd
  • Status changed from new to assigned

comment:2 Changed 9 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.

comment:3 Changed 9 years ago by erikd

  • Resolution set to fixed
  • Status changed from assigned to closed

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.

comment:4 Changed 7 years ago by benl

  • Milestone 0.1.3 deleted

Milestone 0.1.3 deleted

Note: See TracTickets for help on using tickets.