Opened 4 years ago

Last modified 2 years ago

#10976 new feature request

Applicative Comprehensions

Reported by: davidar Owned by:
Priority: normal Milestone:
Component: Compiler Version:
Keywords: ApplicativeDo Cc: simonmar, RyanGlScott
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking: #8914
Related Tickets: #8914 Differential Rev(s):
Wiki Page:

Description (last modified by thomie)

As discussed on ghc-devs, when both the MonadComprehensions and ApplicativeDo language extensions are enabled, it should be possible to use comprehension-notation (in addition to do-notation) for Applicatives. This would allow, for example, an expression like

(\x y -> x + 2*y) <$> ZipList [1..10] <*> ZipList [10,20..100]

to also be written as

[ x + 2*y | x <- ZipList [1..10], y <- ZipList [10,20..100] ]

Change History (5)

comment:1 Changed 4 years ago by thomie

Description: modified (diff)

comment:2 Changed 4 years ago by thomie

Milestone: 8.0.1

comment:3 Changed 3 years ago by RyanGlScott

Cc: RyanGlScott added

comment:4 Changed 3 years ago by Iceland_jack

comment:5 Changed 2 years ago by RyanGlScott

Keywords: ApplicativeDo added
Note: See TracTickets for help on using tickets.