
26 Jan
2010
26 Jan
'10
11:12 p.m.
Didn't recognize the sameness. Aside from there being many ways to do the same thing, partial application makes the mixup even merrier.
Thanks,
Michael
--- On Tue, 1/26/10, Edward Z. Yang
fromMaybe d x = case x of {Nothing -> d;Just v -> v} fromMaybe z = maybe z id
They're equivalent. Here the definition of maybe: maybe :: b -> (a -> b) -> Maybe a -> b maybe n _ Nothing = n maybe _ f (Just x) = f x Cheers, Edward