[Haskell-cafe] Why is this strict in its arguments?
Ryan Ingram
ryani.spam at gmail.com
Thu Dec 6 17:21:28 EST 2007
On 12/6/07, Luke Palmer <lrpalmer at gmail.com> wrote:
>
> I have actually seen this pattern a lot recently. Recently I have
> started using a function:
>
> mergeMaybes :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
> mergeMaybes f Nothing y = y
> mergeMaybes f x Nothing = x
> mergeMaybes f (Just x) (Just y) = Just (f x y)
mergeMaybes = liftM2 -- from Control.Monad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071206/676e892f/attachment.htm
More information about the Haskell-Cafe
mailing list