
On Wed, Jul 20, 2011 at 10:50 AM, Roelof Wobben
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
You could say:
x = replicate 3 True
or:
main = print (replicate 3 True)
Antoine
________________________________ Date: Wed, 20 Jul 2011 11:47:51 -0400 Subject: Re: [Haskell-beginners] Parse error: naked expression at top level From: allbery.b@gmail.com To: rwobben@hotmail.com CC: beginners@haskell.org
On Wed, Jul 20, 2011 at 11:30, Roelof Wobben
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@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners