
7 Jul
2010
7 Jul
'10
4:15 a.m.
David Virebayre wrote:
On Wed, Jul 7, 2010 at 9:19 AM, Michael Mossey
wrote: doSomething :: Maybe Result doSomething item = case item of note@(Note _ _ _ _ _) -> Just $ process note _ -> Nothing
But I don't like writing "Note _ _ _ _ _"
isNote (Note _ _ _ _ _) = True isNote _ = False
doSomething :: Maybe Result doSomething item | isNote item = Just $ process note | otherwise = Nothing
But I don't like writing "Note _ _ _ _ _"
I think this is pretty good because I can use isNote with a filter in another function. Thanks, Mike