
19 Oct
2009
19 Oct
'09
1:21 p.m.
On Mon, Oct 19, 2009 at 12:07:19PM +0200, Christian Maeder wrote:
Michael Mossey schrieb:
Is there a nifty way to write
filter (\x -> x < 0.5 && x > -0.5) xs
without explicitly using x?
Hoogle did not find a function of type:
(b -> b -> b) -> (a -> b) -> (a -> b) -> a -> b
or (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
Apparently Hoogle does not know to try unifying m b with a -> b. As others have pointed out, a function of this type (actually, a more general type) does exist, namely, liftM2. -Brent