[Haskell-beginners] loop problem

Tom Murphy amindfv at gmail.com
Wed Jul 20 20:25:27 CEST 2011


Hi Roelof,
     For small questions like this, you might want to try the Haskell
IRC channel (http://www.haskell.org/haskellwiki/IRC_channel).

Tom

On 7/20/11, Roelof Wobben <rwobben at hotmail.com> wrote:
>
> 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
>
>



More information about the Beginners mailing list