1

My code looks like this:

threeByThree :: Sudoku -> [Block]
threeByThree sudoku = (chunksOf 9(concat(transpose(take 3 (rows sudoku)))++
    (transpose(take 3 rs))++(transpose xs)))
      where 
        rs <- drop 3 (rows sudoku)
        xs <- drop 3 rs

The error message I'm receiving:

Sudoku.hs:130:12: parse error on input `<-'

Which should be exactly at the first arrow. Am I missing the obvious here?

2 Answers 2

4

Probably you meant:

where 
   rs = drop 3 (rows sudoku)
   xs = drop 3 rs

Note that <- has got a different meaning. It is used in the context of Monad desugaring.

Sign up to request clarification or add additional context in comments.

Comments

1

@Sibi has the correct answer to your specific problem. I just wanted to briefly mention that this error usually means that you forgot to put do at the beginning of a do block:

-- Parse error on input `<-'
example1 =
    x <- m
    y <- n

-- How to fix the error:
example2 = do
    x <- m
    y <- n

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.