withinBounds
  :: Position -- ^ Coordinates of position to check
  -> Matrix.Matrix [a] -- ^ `Matrix` to test against
  -> Bool -- ^ Whether the given position lies within the matrix
withinBounds (x, y) m =
  case Matrix.safeGet y x m of
    Nothing -> False
    Just v -> not $ null v
withinBounds
  :: Position -- ^ Coordinates of position to check
  -> Matrix.Matrix [a] -- ^ `Matrix` to test against
  -> Bool
withinBounds (x, y) m =
  case Matrix.safeGet y x m of
    Nothing -> False
    Just v -> not $ null v
withinBounds (x, y) m =
  case Matrix.safeGet y x m of
    Nothing -> False
    Just v -> not $ null v