--Тип Board и функция nextPositions заданы, реализовывать их не нужно
nextPositionsN :: Board -> Int -> (Board -> Bool) -> [Board]
nextPositionsN b n pred | n<0 = []
| n == 0 = if pred b then [b] else []
| otherwise = do
np <- nextPositions b
npr <- nextPositionsN np (n-1) pred
return npr