Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#9099 closed feature request (fixed)

Add strict fmap

Reported by: quchen Owned by:
Priority: normal Milestone: 7.10.1
Component: libraries/base Version: 7.8.2
Keywords: report-impact Cc: hvr, ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Add a strict version of fmap to the standard libraries.

infixl 4 <$!>
  
(<$!>) :: Monad m => (a -> b) -> m a -> m b
f <$!> m = do x <- m
              return $! f x
{-# INLINE (<$!>) #-}

Libraries discussions:

Take 1: http://www.haskell.org/pipermail/libraries/2013-November/021728.html Take 3: http://www.haskell.org/pipermail/libraries/2014-April/022864.html

Attachments (1)

0001-Add-strict-ver.-of-to-Control.Monad.patch (1.9 KB) - added by bernalex 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by bernalex

comment:1 Changed 5 years ago by bernalex

Cc: hvr ekmett added
Component: Nonelibraries/base
Status: newpatch

comment:2 Changed 5 years ago by ekmett

No objection here.

It also passed unanimously through the libraries@ proposal process.

comment:3 Changed 5 years ago by Herbert Valerio Riedel <hvr@…>

In 0148a1c416e42a7d7c9ff3624a0640963bfe0012/ghc:

Add strict ver. of (<$>): (<$!>) to Control.Monad

A strict (<$>) has been proposed numerous times. The first time
around[1] by Johan Tibell, and the last time around[2] by David
Luposchainsky. David's thread was able to avoid The Bikeshed Monster,
and his (<$!>) proposal received unanimous +1s all around.

This addresses #9099.

 [1]: http://www.haskell.org/pipermail/libraries/2013-November/021728.html
 [2]: http://www.haskell.org/pipermail/libraries/2014-April/022864.html

Authored-by: Alexander Berntsen <alexander@plaimi.net>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>

comment:4 Changed 5 years ago by tibbe

Resolution: fixed
Status: patchclosed

comment:5 Changed 4 years ago by hvr

Keywords: report-impact added
Milestone: 7.10.1
Note: See TracTickets for help on using tickets.