I have a function funcM :: a -> b -> c -> IO (x, y)
I want to write a function funcM_ :: a-> b-> c-> IO x so:
funcM_ = fst `fmap` funcM -- error
I could add back all the points, but it seems like there should be something I could replace fmap with so that the above will work. Kind of like replacing ($) with (.) would make this work in a pure context.
What is the function I am looking for?
Add a dot for each argument to
funcMThese are all equivalent:
Note that all I did was change the implicit
($)to(.). :-)(.)is the implementation offmapfor the function instance ofFunctor:GHCi
:tis your friend.