Reputation: 23135
Here's a class, I'm calling BlahMap
:
class BlahMap t where
blahMap :: (m a -> n b) -> t m a -> t n b
This is an instance of BlahMap
:
instance BlahMap (ReaderT r) where
blahMap f = ReaderT . fmap f . runReaderT
Is there an existing class in the Haskell ecosystem that does this? Or alternatively, can I just write a function blahMap
with appropriate constraints with existing classes in say mtl
or something similar? Or have I actually invented something new?
Upvotes: 6
Views: 112