In search of: [a->b] -> a -> [b]

Graham Klyne gk@ninebynine.org
Tue, 17 Jun 2003 21:01:57 +0100


I'm convinced I've seen a function like this somewhere:
   [a->b] -> a -> [b]
but cannot remember where.  Or maybe:
   Monad m => m (a->b) -> a -> m b
?

I could roll my own (*), but I'm trying not to duplicate standard library 
functions is I can help it.  Any pointers?

#g
--

(*)

     flist :: [a->b] -> a -> [b]
     flist fs a = map (flip ($) a) fs

     flist [(1*),(2*),(3*)] 5 -- = [5,10,15]


-------------------
Graham Klyne
<GK@NineByNine.org>
PGP: 0FAA 69FF C083 000B A2E9  A131 01B9 1C7A DBCA CB5E