[Haskell-beginners] Utter Newbie - simple problems, output - GHC vs GHCi

Magnus Therning magnus at therning.org
Sun Aug 30 18:13:14 EDT 2009


On Sun, Aug 30, 2009 at 11:09 PM, Nigel Rantor<wiggly at wiggly.org> wrote:
>
> I am trying to get my head around Haskell but seem to keep butting
> against problems that have nothing to do with FP yet, but are simply to
> do with not understanding the tools.
>
> I've been trying a lot of code from multiple tutorials but I keep
> finding that the code simply does not work out of the box, and requires
> some other setup I am unaware of.
>
> I am currently on Debian, using GHC 6.8.2 installed using apt, so I
> assume that the toolchain is installed and working correctly.
>
> For example, the most recent tutorial I've been looking at is the "yet
> another haskell tutorial", here -
> http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf
>
> One of the exercises after talking about functions that act on lists is
> to determine the number of lowercase letters in a string.
>
> Fine, that makes complete sense to me. I figure something along the
> lines of:
>
> length( filter( Char.isLower "LoweR" ) )

try this instead

length (filter Char.isLower "LoweR")

`filter` takes two arguments.

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe


More information about the Beginners mailing list