[GHC] #4370: Bring back monad comprehensions

GHC cvs-ghc at haskell.org
Mon Jul 4 21:25:22 CEST 2011


#4370: Bring back monad comprehensions
------------------------------+---------------------------------------------
  Reporter:  simonpj          |          Owner:                  
      Type:  feature request  |         Status:  new             
  Priority:  normal           |      Milestone:  7.4.1           
 Component:  Compiler         |        Version:  6.12.3          
Resolution:                   |       Keywords:                  
  Testcase:                   |      Blockedby:                  
Difficulty:                   |             Os:  Unknown/Multiple
  Blocking:                   |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown     |  
------------------------------+---------------------------------------------
Changes (by giorgidze):

  * owner:  nsch =>
  * status:  closed => new
  * resolution:  fixed =>


Comment:

 Currently, the munzip function is not a member of the MonadZip class. It
 has the following type signature and definition:

 {{{
 munzip :: MonadZip m => m (a,b) -> (m a, m b)
 munzip mab = (liftM fst mab, liftM snd mab)
 }}}

 When developing monad comprehension examples for various MonadZip
 instances, I found that it is useful to allow a MonadZip instance to
 provide more efficient unzipping function.

 I suggest we make the munzip function a member of the MonadZip class by
 using the current definition as a default implementation. The laws that
 the munzip member should satisfy is already documented in the module.

 The small patch that is attached to this trac ticket implements the
 proposed change.

 Cheers, George

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4370#comment:61>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list