Ticket #171 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Parse error on list comprehension

Reported by: erikd Owned by: bens
Priority: blocker Milestone: 0.1.3
Component: Source Parser Version: 0.1.2
Keywords: Cc:

Description

The following list comprehension compiles with GHC, but doesn't compile with DDC:

tricky xs = [ (x, y)
		| x	<- xs
		, let y = x `mod` 3]

main () = putStrLn $ show $ tricky [ 1, 2, 3 ]

Attachments

171.dpatch (192.9 kB) - added by benl 4 years ago.

Change History

  Changed 4 years ago by erikd

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

follow-up: ↓ 3   Changed 4 years ago by erikd

This one is closely related to #143.

in reply to: ↑ 2   Changed 4 years ago by erikd

Replying to erikd:

This one is closely related to #143.

Not #143, #147 (Parse Let).

  Changed 4 years ago by erikd

ALso need to parse this:

thing xs = [ (x, y) | z <- xs, let (Just x, Just y) = z ]

  Changed 4 years ago by erikd

With the following patch:

Sat Mar 6 12:08:32 EST 2010 Erik de Castro Lopo <erikd@…>

  • Add parsing of let statements within list comprehensions.

the parser accepts let statements within list comprehensions but the Desugarer/Renamer etc still need to be updated.

  Changed 4 years ago by bens

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

  Changed 4 years ago by batterseapower

Changed 4 years ago by benl

  Changed 4 years ago by erikd

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

Max's patch applied and test moved into main test suite.

Thanks Max.

Note: See TracTickets for help on using tickets.