[Haskell-beginners] Parse error: naked expression at top level

Roelof Wobben rwobben at hotmail.com
Wed Jul 20 17:50:13 CEST 2011


Oke, 

So  In the file I have to load I must put the first 2 lines.
And in the prompt I have to do the last line,

Or is there a way I can use all three lines in a file ?

Roelof


Date: Wed, 20 Jul 2011 11:47:51 -0400
Subject: Re: [Haskell-beginners] Parse error: naked expression at top level
From: allbery.b at gmail.com
To: rwobben at hotmail.com
CC: beginners at haskell.org

On Wed, Jul 20, 2011 at 11:30, Roelof Wobben <rwobben at hotmail.com> wrote:





replicate :: Int -> a -> [a]
replicate a xs = [xs | x' <= a <--xs]

replicate 3 True

That last line is fine at a GHCi prompt but not in a program.  (Files loaded by ghci are not scripts!  They are treated the same way as program files fed to ghc or runhaskell.)

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms



 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110720/2cc34ccb/attachment.htm>


More information about the Beginners mailing list