touchedPoints :: PrimMonad m => Canvas (PrimState m) -> Points -> m Points
touchedPoints canvas points = do
    validPoints <- V.filterM (touchedPoint canvas) points
    return validPoints

--getTouchedPoint :: PrimMonad m => Canvas (PrimState m) -> Points -> m P2
--getTouchedPoint canvas points = do
--    validPoints <- V.filterM (touchedPoint canvas) points
--    return $ V.head $ V.take 1 validPoints

--touchedPoint :: PrimMonad m => Canvas (PrimState m) -> P2 -> m Bool
--touchedPoint canvas point = do
--    (_,_,touched) <- UM.read canvas (index point)
--    if touched then return True else return False
touchedPoints :: PrimMonad m => Canvas (PrimState m) -> Points -> m Points
touchedPoints canvas points = do
    validPoints <- V.filterM (touchedPoint canvas) points
    return validPoints

--getTouchedPoint :: PrimMonad m => Canvas (PrimState m) -> Points -> m P2
--getTouchedPoint canvas points = do
--    validPoints <- V.filterM (touchedPoint canvas) points
--    return $ V.head $ V.take 1 validPoints

--touchedPoint :: PrimMonad m => Canvas (PrimState m) -> P2 -> m Bool
--touchedPoint canvas point = do
--    (_,_,touched) <- UM.read canvas (index point)
--    if touched then return True else return False
touchedPoints canvas points = do
    validPoints <- V.filterM (touchedPoint canvas) points
    return validPoints

--getTouchedPoint :: PrimMonad m => Canvas (PrimState m) -> Points -> m P2
--getTouchedPoint canvas points = do
--    validPoints <- V.filterM (touchedPoint canvas) points
--    return $ V.head $ V.take 1 validPoints

--touchedPoint :: PrimMonad m => Canvas (PrimState m) -> P2 -> m Bool
--touchedPoint canvas point = do
--    (_,_,touched) <- UM.read canvas (index point)
--    if touched then return True else return False