[GHC] #10976: Applicative Comprehensions
GHC
ghc-devs at haskell.org
Fri Oct 30 11:54:28 UTC 2015
#10976: Applicative Comprehensions
-------------------------------------+-------------------------------------
Reporter: davidar | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version:
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking: 8914
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by thomie:
Old description:
> 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
> `Applicative`s. This would allow, for example, an expression like
>
> {{{#!hs
> (\x y -> x + 2*y) <$> ZipList [1..10] <*> ZipList [10,20..100]
> }}}
>
> to also be written as
>
> {{{#!hs
> [ x + 2*y | x <- ZipList [1..10], y <- ZipList [10,20..100] ]
> }}}
New description:
As discussed on [https://mail.haskell.org/pipermail/ghc-
devs/2015-October/010062.html 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 `Applicative`s. This would allow, for example, an expression
like
{{{#!hs
(\x y -> x + 2*y) <$> ZipList [1..10] <*> ZipList [10,20..100]
}}}
to also be written as
{{{#!hs
[ x + 2*y | x <- ZipList [1..10], y <- ZipList [10,20..100] ]
}}}
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10976#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list