I have a type constructor
type SimpleFcn α m = m α -> m α
and I want to use it in a class where it will be further parameterized later. Namely,
instance A (SimpleFcn α)
In my situation, any functions in the class A would be parametric in argument m.
class A β where f :: Monad m => β m
instance A (SimpleFcn α) where f x = x
What is an appropriate workaround for this situation?
It is not possible to partitially apply type synonyms, as they are just a way to shorten your code and not real type-level lambdas. You can try to use a newtype instead.
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