Changes between Version 2 and Version 3 of ParallelListComp


Ignore:
Timestamp:
Feb 16, 2006 12:17:48 PM (8 years ago)
Author:
ross@…
Comment:

summarize mailing list discussion

Legend:

Unmodified
Added
Removed
Modified
  • ParallelListComp

    v2 v3  
    66== Brief Explanation == 
    77 
     8Parallel comprehensions extend list comprehensions with a notation for zips. 
     9The comprehension 
     10{{{ 
     11[ e | quals1 | ... | qualsN ] 
     12}}} 
     13can be desugared to 
     14{{{ 
     15zipWithN (\ p1 ... pN -> e) [p1 | quals1] ... [pN | qualsN] 
     16}}} 
     17where `p`,,i,, is a tuple of the variables defined by `quals`,,i,, and used by `e`. 
     18 
    819== References == 
    9  * [http://cvs.haskell.org/Hugs/pages/users_guide/hugs-ghc.html#ZIP-COMPREHENSION Hugs] reference. 
     20 * [http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#parallel-list-comprehensions Parallel list comprehensions] in the GHC User's Guide 
    1021 
    1122== Tickets == 
     
    1324 
    1425== Pros == 
    15  * Easy & straightforward 
     26 * Easy and well-specified 
    1627 
    1728== Cons == 
    18  * No big downsides 
     29 * Not widely used, and not hugely more concise than using explicit zips. 
     30 * Naive users can trip over them if they misplace a '`|`'. 
     31 * In its more general forms it's hard to predict how the elements from each set of generators and filters will match up, e.g. 
     32   {{{ 
     33[(i,j,k) | i <- [1..3], j <- [1..3] | k <- [1..9]] 
     34}}} 
     35 * The notation expresses zips of filters and maps, but not filters of zips, which are more common.