[Haskell-beginners] GHCi won't allow type declaration as shown in LYAHFGG
Homero Cardoso de Almeida
homerocda at gmail.com
Thu May 31 21:52:22 CEST 2012
I don't think GHCi allows function and type definitions in interactive mode.
You have to write the functions in a source file and then load it. You can
then call the functions as usual.
Homero Cardoso de Almeida
On Thu, May 31, 2012 at 4:48 PM, Stan Kulp <stan_kulp at yahoo.com> wrote:
> I have been working my way through "Learn You a Haskell for Greater Good"
> and am stumped when I get to the "Syntax in Functions - Pattern Matching"
> section.
>
> The book shows the following expression...
>
> ghci> lucky :: (Integral a) => a -> **String
>
> ...but when I try to execute it in GHCi I get the following error...
>
> <interactive>:1:1: Not in scope: `lucky'
>
> What am I missing?
>
> Stan Kulp
> 4421 W North Pinebrook Lane
> Columbia, MO 65203
>
> Home: 573-234-2065
> Work: 573-522-5075
> Cell: 573-864-6051
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120531/06a748c2/attachment.htm>
More information about the Beginners
mailing list