import Prelude class Something a where getSomething :: forall b. Something b => a -> Maybe b data Bar = Bar Foo instance Something Bar where getSomething (Bar foo) = Just foo data Foo = Foo instance Something Foo where getSomething Foo = Nothing