How can i get the type of a polymorphic function for a specific type class instance?
问题 For example, typing :t ap in GHCi gives the result ap :: Monad m => m (a -> b) -> m a -> m b If I already know the Monad instance I'm going to use is ((->) r) , how can I query for the type of ap for that specific instance? 回答1: You can use visible type application feature to specify parametric types. You can look at functions in more creative way: functions in Haskell can be applied to not only values of some types, but also to types of that values. But to pass type you should somehow