Pawel
Pawel

Reputation: 113

Why I am getting " parse error on input `<-' "?

Here is my code

lotto blacklista size board current = [black | blacklista<-action current , warunki blacklista,
                                                if end current
                                                   then if check board blacklista
                                                   then black <- blacklista
                                                          else False
                                                else black <- lotto blacklista size board (next current) ]

Can you tell me why I am getting parse error in this line?

then black <- blacklista

Upvotes: 1

Views: 151

Answers (2)

wit
wit

Reputation: 1622

You could try Monad (new do block) after then and else.

Upvotes: 1

Ankur
Ankur

Reputation: 33637

From whatever context you have provided, it seems you want something like this:

lotto blacklista size board current = let blist = action current warunki blacklista in
                                          [black | black <- if end current && check board blist then blist
                                                            else lotto blacklista size board (next current)] 

Upvotes: 1

Related Questions