If I have a function (e.g. of type a -> b
) wrapped in an Applicative
and a value that can be applied to it (i.e. a value of type a
in the above example), I can apply it as follows:
doSomething :: Applicative f => f (a -> b) -> a -> f b
doSomething wrappedFn arg = wrappedFn <*> (pure arg)
I find myself doing this a lot. Is there a standard, predefined operator somewhere that will make this code more concise, or do I need to define one myself? If the latter, is there a conventional name for it?