<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">A "map" can be a function (applied to a (single) value).<br><br>Got it.<br><br>Thanks,<br><br>Michael<br><br><br>--- On <b>Fri, 8/27/10, Ivan Lazar Miljenovic <i><ivan.miljenovic@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Ivan Lazar Miljenovic <ivan.miljenovic@gmail.com><br>Subject: Re: [Haskell-cafe] On to applicative<br>To: "michael rice" <nowgate@yahoo.com><br>Cc: haskell-cafe@haskell.org<br>Date: Friday, August 27, 2010, 8:46 PM<br><br><div class="plainMail">On 28 August 2010 10:38, michael rice <<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>> wrote:<br>><br>> fmap seems oddly named because no "mapping" takes place, except in the fourth example, where the map is "passed in." Just
sayin'.<br><br>*ahem* <a href="http://en.wikipedia.org/wiki/Map_%28mathematics%29" target="_blank">http://en.wikipedia.org/wiki/Map_%28mathematics%29</a><br><br>> Prelude Control.Monad Control.Applicative Data.Char> fmap toUpper getLine<br>><br>> <interactive>:1:13:<br>> Couldn't match expected type `Char' against inferred type `[Char]'<br>> Expected type: IO Char<br>> Inferred type: IO String<br>> In the second argument of `fmap', namely `getLine'<br>> In the expression: fmap toUpper getLine<br><br>Right; this is because the fmap only gets the "Char -> Char" function<br>inside the IO; but since it's "IO String" rather than "IO Char", this<br>doesn't type-check.<br><br>--<br>Ivan Lazar Miljenovic<br><a ymailto="mailto:Ivan.Miljenovic@gmail.com"
href="/mc/compose?to=Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>IvanMiljenovic.wordpress.com<br></div></blockquote></td></tr></table><br>