What should I use if I want to have something like
[a->b] -> a -> [b]
basically I have a list of functions, all take in a value a and returns b. I want to apply all of them to one a and get the results [b].
Which one should I use?
Thanks
You don't need
Traversable, justFunctor:See also the
swingfunction (this is equivalent toswing fmap).Or, if you're using Edward Kmett's
distributivelibrary, you can have the best of both this answer (only aFunctorrather than aTraversable) and chi's answer (avoiding defining a custom function for the job), by usingdistributefrom Data.Distributive.