[Haskell-beginners] loop problem

Roelof Wobben rwobben at hotmail.com
Wed Jul 20 18:29:57 CEST 2011


Hello, 

I need to make a sort of loop so a text is displayed several times.

So this idea :

repeat 3 true will be True True True.

So in another language I would have programmed.


for teller = 1 to a 
    print text 

But I need to use list comprehession.

So I thougt I use this :

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

But now I get this message :

oefening.hs:2:24: Parse error in pattern: x' <= a


Where did I go wrong here ?

Roelof

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


More information about the Beginners mailing list