patch applied (ghc): Add fmapM_maybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)

Simon Marlow marlowsd at gmail.com
Fri Jul 24 04:42:29 EDT 2009


On 23/07/2009 20:15, Max Bolingbroke wrote:
> 2009/7/23 Simon Marlow<marlowsd at gmail.com>:
>> On 23/07/2009 13:18, Simon Peyton Jones wrote:
>>>
>>> Wed Jul 22 23:49:32 PDT 2009  simonpj at microsoft.com
>>>    * Add fmapM_maybe :: Monad m =>    (a ->    m b) ->    Maybe a ->    m (Maybe b)
>>>    Ignore-this: db5f6319b52a5e6b5f85d76985f2a7c9
>>>
>>>    This function isn't used at the moment, but Max added it, and it
>>>    looks useful.
>>
>> It's an instance of Data.Traversable.mapM (which we're allowed to use in GHC
>> HEAD, because it was in GHC 6.8).
>
> Ah, I thought Traversable was still verboten, hence my addition.
> Still, defining a full Traversable instance is a ton of work compared
> to this 1-2 liner :-)

Traversable Maybe is already provided, so 0 lines :)

Cheers,
	Simon




More information about the Cvs-ghc mailing list