Using the extension TypeSynonymInstances
it is possible to write an instance like that:
instances MyClass String where ...
Using newtype
it is possible to declare an instance like that:
newtype Kleisli m a b = Kleisli (a -> m b)
instance MyClass (Kleisli m) where ...
I now that it is not possible to do the following:
type Kleisli m a b = a -> m b
instance MyClass (Kleisli m) where ...
Now is there an extension that allows me to do so? If not, what problems prohibit such an extension?
Haskell doesn't allow partially applied type synonyms ever since deciding equality between a type and a partially applied type synonym is equivalent to deciding whether two functions are equal. This is undecidable in general.
Recall that type synonyms are type level functions (that happen to be parametric in their arguments).
This is why it's generally encouraged to rely on partial application as much as possible in the definition of a type synonym. Though this doesn't seem possible in your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With