Imagine that there is some class:
class Foo a where
g :: b -> a
f :: a -> b
I want to be able to write the following function:
h :: a -> a
h = f . g
But to do this I need some way to specify the exact instance of Foo I'm using. Is there some way to do this simillar to how Rust uses traits? I'm pretty certain I could use template haskell to build this function with a supplied class each time, but if possible I'd like to about that.