foo :: (a -> b) -> SomeMessage -> b foo f (SM x) = f x