[Haskell-cafe] On to applicative
michael rice
nowgate at yahoo.com
Thu Aug 26 02:09:14 EDT 2010
Yeah, I figured as much, but the code is copied right off the referenced page.
Michael
--- On Thu, 8/26/10, Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com> wrote:
From: Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com>
Subject: Re: [Haskell-cafe] On to applicative
To: "michael rice" <nowgate at yahoo.com>
Cc: haskell-cafe at haskell.org
Date: Thursday, August 26, 2010, 2:02 AM
On 26 August 2010 15:56, michael rice <nowgate at yahoo.com> wrote:
>
> From: http://en.wikibooks.org/wiki/Haskell/Applicative_Functors
>
> =============================
> import Control.Applicative
>
> f :: (a -> b -> c)
> fmap :: Functor f => (d -> e) -> f d -> f e
> fmap f :: Functor f => f a -> f (b -> c) -- Identify d with a, and e with (b -> c)
>
> sumsqr :: Int -> Int -> Int -- my f
> sumsqr i j = i*i+j*j
> =============================
The line with the error is the one beginning with "fmap f :: ..."; you
can't provide a variable/parameter on the left hand side of the ::
Also, why are you trying to re-define fmap?
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100826/659ce809/attachment-0001.html
More information about the Haskell-Cafe
mailing list