scanFullRows :: Grid -> [Int]
scanFullRows grid = catMaybes . P.map checkFull $ rows
  where
    (R.Z :. w :. h) = extent grid
    getRow y = computeVectorS $ extract (R.Z :. 0 :. y) (R.Z :. 10 :. 1) grid
    range = [0 .. h -1]
    -- e.g. rows = [(0, Nothing), (1, Just J) ... ]
    rows = P.zip range $ P.map getRow range

    checkFull :: (Int, Grid) -> Maybe Int
    checkFull (ix, row) = do isFull <- foldAllP (&&) True $ R.map isJust row
                             case isFull of
                               False -> Nothing -- Ain't full, please disregard
                               True -> Just ix -- Full row here, remember the index!

-- | handles change in row count
scanFullRows :: Grid -> [Int]
scanFullRows grid = catMaybes . P.map checkFull $ rows
  where
    (R.Z :. w :. h) = extent grid
    getRow y = computeVectorS $ extract (R.Z :. 0 :. y) (R.Z :. 10 :. 1) grid
    range = [0 .. h -1]
    -- e.g. rows = [(0, Nothing), (1, Just J) ... ]
    rows = P.zip range $ P.map getRow range

    checkFull :: (Int, Grid) -> Maybe Int
    checkFull (ix, row) = do isFull <- foldAllP (&&) True $ R.map isJust row
                             case isFull of
                               False -> Nothing -- Ain't full, please disregard
                               True -> Just ix -- Full row here, remember the index!

-- | handles change in row count
scanFullRows grid = catMaybes . P.map checkFull $ rows
  where
    (R.Z :. w :. h) = extent grid
    getRow y = computeVectorS $ extract (R.Z :. 0 :. y) (R.Z :. 10 :. 1) grid
    range = [0 .. h -1]
    -- e.g. rows = [(0, Nothing), (1, Just J) ... ]
    rows = P.zip range $ P.map getRow range

    checkFull :: (Int, Grid) -> Maybe Int
    checkFull (ix, row) = do isFull <- foldAllP (&&) True $ R.map isJust row
                             case isFull of
                               False -> Nothing -- Ain't full, please disregard
                               True -> Just ix -- Full row here, remember the index!

-- | handles change in row count