
7 Jul
2010
7 Jul
'10
3:26 a.m.
Hi Michael Untested - maybe you can use Record puns (section 7.3.15.of the GHC manual). Though they might only work if you have used field names in your data type. {} swaps for _ _ _ _ _ _ so it would be:
doSomething :: Maybe Result doSomething item = case item of note@(Note {}) -> Just $ process note _ -> Nothing