<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Vo,<br><br>Pardon, I grabbed the wrong lines.<br><br>*Main&gt; :t (-&gt;) 3 "abc"<br><br>&lt;interactive&gt;:1:1: parse error on input `-&gt;'<br><br>Michael<br><br>--- On <b>Tue, 8/31/10, Vo Minh Thu <i>&lt;noteed@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Vo Minh Thu &lt;noteed@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] On to applicative<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: "Ryan Ingram" &lt;ryani.spam@gmail.com&gt;, haskell-cafe@haskell.org<br>Date: Tuesday, August 31, 2010, 3:07 PM<br><br><div class="plainMail">2010/8/31 michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt;<br>&gt; Hi, Ryan and all,<br>&gt;<br>&gt; Bingo! I guess my question was all right after
 all.<br>&gt;<br>&gt; I tried creating an instance earlier but<br>&gt;<br>&gt; *Main&gt; :t (-&gt;) Int Char<br>&gt;<br>&gt; &lt;interactive&gt;:1:1: parse error on input `-&gt;'<br><br>&nbsp; :t Int<br>does not make sense but<br>&nbsp; :t undefined :: Int<br>is ok, just like<br>&nbsp;&nbsp;&nbsp;:t undefined :: (-&gt;) Int Int<br><br>&gt; What got loaded with FmapFunc? I Hoogled it and got back nothing.<br>&gt;<br>&gt; Michael<br>&gt;<br>&gt; --- On Tue, 8/31/10, Ryan Ingram &lt;<a ymailto="mailto:ryani.spam@gmail.com" href="/mc/compose?to=ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt; From: Ryan Ingram &lt;<a ymailto="mailto:ryani.spam@gmail.com" href="/mc/compose?to=ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt;<br>&gt; Subject: Re: [Haskell-cafe] On to applicative<br>&gt; To: "michael rice" &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt; Cc: "Vo Minh
 Thu" &lt;<a ymailto="mailto:noteed@gmail.com" href="/mc/compose?to=noteed@gmail.com">noteed@gmail.com</a>&gt;, <a ymailto="mailto:haskell-cafe@haskell.org" href="/mc/compose?to=haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>&gt; Date: Tuesday, August 31, 2010, 2:36 PM<br>&gt;<br>&gt; Prelude FmapFunc&gt; let s = show :: ((-&gt;) Int) String<br>&gt; Prelude FmapFunc&gt; :t s<br>&gt; s :: Int -&gt; String<br>&gt; Prelude FmapFunc&gt; let v = fmap ("hello " ++) s<br>&gt; Prelude FmapFunc&gt; :t v<br>&gt; v :: Int -&gt; String<br>&gt; Prelude FmapFunc&gt; v 1<br>&gt; "hello 1"<br>&gt;<br>&gt; &nbsp; -- ryan<br>&gt;<br>&gt; On Tue, Aug 31, 2010 at 11:28 AM, michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt; wrote:<br>&gt;<br>&gt; I'm not sure if my terminology is correct or even if my question makes sense, but I can create "instances" of Maybe, List, IO, and
 Either.<br>&gt;<br>&gt; Prelude Data.Either&gt; let m = Just 7<br>&gt; Prelude Data.Either&gt; :t m<br>&gt; m :: Maybe Integer<br>&gt;<br>&gt; Prelude Data.Either&gt; let l = 2:[]<br>&gt; Prelude Data.Either&gt; :t l<br>&gt; l :: [Integer]<br>&gt;<br>&gt; Prelude Data.Either&gt; let g = getLine<br>&gt; Prelude Data.Either&gt; :t g<br>&gt; g :: IO String<br>&gt;<br>&gt; Prelude Data.Either&gt; let e = Right "abc"<br>&gt; Prelude Data.Either&gt; :t e<br>&gt; e :: Either a [Char]<br>&gt;<br>&gt; All these instances are functors, each with its own version of fmap that can be applied to it.<br>&gt;<br>&gt; How can I similarly create an instance of (-&gt;) so I can apply (-&gt;)'s version of fmap<br>&gt;<br>&gt; instance Functor ((-&gt;) r) where<br>&gt; &nbsp;&nbsp;&nbsp; fmap f g = (\x -&gt; f (g x))<br>&gt;<br>&gt; to it?<br>&gt;<br>&gt; Michael<br>&gt;<br>&gt; --- On Tue, 8/31/10, Vo Minh Thu &lt;<a ymailto="mailto:noteed@gmail.com"
 href="/mc/compose?to=noteed@gmail.com">noteed@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt; From: Vo Minh Thu &lt;<a ymailto="mailto:noteed@gmail.com" href="/mc/compose?to=noteed@gmail.com">noteed@gmail.com</a>&gt;<br>&gt; Subject: Re: [Haskell-cafe] On to applicative<br>&gt; To: "michael rice" &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt; Cc: <a ymailto="mailto:haskell-cafe@haskell.org" href="/mc/compose?to=haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>&gt; Date: Tuesday, August 31, 2010, 1:50 PM<br>&gt;<br>&gt; 2010/8/31 michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt; &gt;<br>&gt; &gt; So it's a type constructor, not a type? Could you please provide a simple example of its usage?<br>&gt;<br>&gt; Sure, although I'm sure you've come by some already.<br>&gt;<br>&gt; -- the identity function<br>&gt;
 id :: a -&gt; a<br>&gt; -- often, we write it like this:<br>&gt; -- id x = x<br>&gt; -- but here we see the relationship between the ananymous function<br>&gt; syntax and the function type:<br>&gt; id = \x -&gt; x<br>&gt;<br>&gt; In fact, if you write in prefix form, it is quite familiar:<br>&gt; f :: (-&gt;) Int Bool<br>&gt; e = Either String Float<br>&gt;<br>&gt; Cheers,<br>&gt; Thu<br>&gt;<br>&gt; &gt; Michael<br>&gt; &gt;<br>&gt; &gt; --- On Tue, 8/31/10, Vo Minh Thu &lt;<a ymailto="mailto:noteed@gmail.com" href="/mc/compose?to=noteed@gmail.com">noteed@gmail.com</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; From: Vo Minh Thu &lt;<a ymailto="mailto:noteed@gmail.com" href="/mc/compose?to=noteed@gmail.com">noteed@gmail.com</a>&gt;<br>&gt; &gt; Subject: Re: [Haskell-cafe] On to applicative<br>&gt; &gt; To: "michael rice" &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt; &gt; Cc: <a
 ymailto="mailto:haskell-cafe@haskell.org" href="/mc/compose?to=haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>&gt; &gt; Date: Tuesday, August 31, 2010, 1:17 PM<br>&gt; &gt;<br>&gt; &gt; 2010/8/31 michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; "Learn You a Haskell ..."&nbsp; says that (-&gt;) is a type just like Either. Where can I find its type definition?<br>&gt; &gt;<br>&gt; &gt; You can't define it *in* Haskell as user code. It is a built-in infix<br>&gt; &gt; type constructor (Either or Maybe are type constructors too, not just<br>&gt; &gt; types). In fact, if you want to implement a simple, typed functional<br>&gt; &gt; language, you'll find it is the only built-in type constructor you<br>&gt; &gt; have to implement (as the implementor of the language).<br>&gt; &gt;<br>&gt; &gt; Also,<br>&gt; &gt; &nbsp; Show a =&gt; a<br>&gt;
 &gt; is a type too, but you won't find a definition for 'a' or for '=&gt;'.<br>&gt; &gt; All those things are defined by the language.<br>&gt; &gt;<br>&gt; &gt; Cheers,<br>&gt; &gt; Thu<br>&gt; &gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Haskell-Cafe mailing list<br>&gt; <a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>&gt;<br>&gt;<br>&gt;<br></div></blockquote></td></tr></table><br>