[GHC] #2461: add Traversable generalizations of mapAccumL and mapAccumR

View: New views
2 Messages — Rating Filter:   Alert me  

[GHC] #2461: add Traversable generalizations of mapAccumL and mapAccumR

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#2461: add Traversable generalizations of mapAccumL and mapAccumR
-------------------------+--------------------------------------------------
    Reporter:  ross      |       Owner:                
        Type:  proposal  |      Status:  new          
    Priority:  normal    |   Component:  libraries/base
     Version:            |    Severity:  normal        
    Keywords:            |    Testcase:                
Architecture:  Unknown   |          Os:  Unknown      
-------------------------+--------------------------------------------------
 The proposal is to add the following functions to Data.Traversable,
 generalizing the list versions in Data.List:
 {{{
 -- |The 'mapAccumL' function behaves like a combination of 'fmap'
 -- and 'foldl'; it applies a function to each element of a structure,
 -- passing an accumulating parameter from left to right, and returning
 -- a final value of this accumulator together with the new structure.
 mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)

 -- |The 'mapAccumR' function behaves like a combination of 'fmap'
 -- and 'foldr'; it applies a function to each element of a structure,
 -- passing an accumulating parameter from right to left, and returning
 -- a final value of this accumulator together with the new structure.
 mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
 }}}
 These functions are handy for things like labelling trees, zipping, etc.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2461>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #2461: add Traversable generalizations of mapAccumL and mapAccumR

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#2461: add Traversable generalizations of mapAccumL and mapAccumR
-------------------------------+--------------------------------------------
    Reporter:  ross            |        Owner:        
        Type:  proposal        |       Status:  closed
    Priority:  normal          |    Milestone:        
   Component:  libraries/base  |      Version:        
    Severity:  normal          |   Resolution:  fixed  
    Keywords:                  |     Testcase:        
Architecture:  Unknown         |           Os:  Unknown
-------------------------------+--------------------------------------------
Changes (by ross):

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

Comment:

 There was limited discussion (with a large sidetrack on <**>).  A few in
 favour, no dissent.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2461#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
LightInTheBox - Buy quality products at wholesale price