Ticket #23 (closed bug report: fixed)

Opened 6 years ago

Last modified 6 years ago

Missing support for generalised list comprehensions

Reported by: nibro Owned by: nibro
Priority: minor Milestone: Full code support
Component: parser Version:
Keywords: Cc:

Description

This extension allows SQL-like clauses in list comprehensions:

employees = [ ("Simon", "MS", 80)
, ("Erik", "MS", 100)
, ("Phil", "Ed", 40)
, ("Gordon", "Ed", 45)
, ("Paul", "Yale", 60)]

output = [ (the dept, sum salary)
| (name, dept, salary) <- employees
, then group by dept
, then sortWith by (sum salary)
, then take 5 ]

Should be trivial to implement parser-wise, like with parallel list comprehensions the main question is how to support these in the AST. Probably keep them separate from ordinary statements. Also I need to investigate if/how parallel and generalised list comprehensions go together. My guess is they simply don't.

http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#generalised-list-comprehensions

Change History

Changed 6 years ago by nibro

  • priority changed from major to minor

Changed 6 years ago by nibro

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

Support added, case closed.

Note: See TracTickets for help on using tickets.