<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">From: http://en.wikibooks.org/wiki/Haskell/Applicative_Functors<br><br>=============================<br>import Control.Applicative<br><br>f :: (a -> b -> c)<br>fmap :: Functor f => (d -> e) -> f d -> f e<br>fmap f :: Functor f => f a -> f (b -> c) -- Identify d with a, and e with (b -> c)<br><br>sumsqr :: Int -> Int -> Int -- my f<br>sumsqr i j = i*i+j*j<br>=============================<br><br>I'm trying to understand how the above works but... <br><br>[michael@localhost ~]$ ghci<br>GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help<br>Loading package ghc-prim ... linking ... done.<br>Loading package integer-gmp ... linking ... done.<br>Loading package base ... linking ... done.<br>Loading package ffi-1.0 ... linking ... done.<br>Prelude> :l bozo.hs<br>[1 of 1] Compiling
Main ( bozo.hs, interpreted )<br><br>bozo.hs:5:0: Invalid type signature<br>Failed, modules loaded: none.<br>Prelude> <br><br><br>Michael<br><br></td></tr></table><br>