
How does one write fmap (fmap (*2)) xs without parenthesis? (Using . and $ instead.) I don't really understand . and $ well enough I guess. I tried a bunch of stuff but nothing worked. -Mike

On Tue, Aug 04, 2009 at 06:02:29PM -0700, Michael P Mossey wrote:
How does one write
fmap (fmap (*2)) xs
without parenthesis? (Using . and $ instead.)
fmap (fmap (*2)) xs flip fmap xs (fmap (*2)) flip fmap xs $ fmap (*2) flip fmap xs $ fmap (\x -> (*) x 2) flip fmap xs $ fmap (\x -> flip (*) 2 x) flip fmap xs $ fmap (flip (*) 2) flip fmap xs $ fmap $ flip (*) 2 -- Felipe.

Michael P Mossey wrote:
How does one write
fmap (fmap (*2)) xs
without parenthesis? (Using . and $ instead.)
I don't think it's possible? "(fmap . fmap) (*2) xs" might be something you like, though. (also, the parentheses from (*2) are section syntax and can't just be removed in the same way) -Isaac

Michael P Mossey wrote:
How does one write
fmap (fmap (*2)) xs
without parenthesis? (Using . and $ instead.)
I don't really understand . and $ well enough I guess. I tried a bunch of stuff but nothing worked.
-Mike _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
fmap . fmap $ (*2) or perhaps: (fmap . fmap) (*2) -- Tony Morris http://tmorris.net/

fmap . fmap is close to applicative ?
is it possible to do applicative instead of combining 2 fmaps ?
Thanks
On Wed, Aug 5, 2009 at 12:29 AM, Tony Morris
Michael P Mossey wrote:
How does one write
fmap (fmap (*2)) xs
without parenthesis? (Using . and $ instead.)
I don't really understand . and $ well enough I guess. I tried a bunch of stuff but nothing worked.
-Mike _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
fmap . fmap $ (*2)
or perhaps:
(fmap . fmap) (*2)
-- Tony Morris http://tmorris.net/
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Federico Brubacher www.fbrubacher.com Colonial Duty Free Shop www.colonial.com.uy
participants (6)
-
Federico Brubacher
-
Felipe Lessa
-
Isaac Dupree
-
Jason Dusek
-
Michael P Mossey
-
Tony Morris