I have a function seperateFuncs such that
seperateFuncs :: [a -> b] -> (a -> [b])
seperateFuncs xs = \\x -> map ($ x) xs
"Is there some datatype f which has a function :: (a -> f b) -> f (a -> b)?"
In fact, there is an even more general version of this function in the Traversable type class, which deals with commutable functors:
class (Functor t, Foldable t) => Traversable t where
...
sequenceA :: Applicative f => t (f b) -> f (t b)
How is this related to your function? Starting from your type, with one type substitution, we recover sequenceA:
(a -> f b) -> f (a -> b) ==> let t = (->) at (f b) -> f (t b) However, this type has the constraint that t must be a Traversable -- and there isn't a Traversable instance for (->) a, which means that this operation can't be done in general with functions. Although note that the "other direction" -- f (a -> b) -> (a -> f b) works fine for all functions and all Applicatives f.