find p@(IOA m _) s@(IOA n _) t = go
  where
    go i j
      | i >= n    = return $ Nothing
      | j >= m    = return $ Just (i - m)
      | otherwise = do si <- getIO s i
                       pj <- getIO p j
                       tj <- getIO t j
                       case () of
                        _ | si == pj  -> go (i+1) (j+1)
                          | j == 0    -> go (i+1) j
                          | otherwise -> go i     tj

---------------------------------------------------------------------------
-- | Make Table -----------------------------------------------------------
---------------------------------------------------------------------------

-- BUG WHAT's going on?
{-@ bob :: Nat -> IO () @-}
find p@(IOA m _) s@(IOA n _) t = go
  where
    go i j
      | i >= n    = return $ Nothing
      | j >= m    = return $ Just (i - m)
      | otherwise = do si <- getIO s i
                       pj <- getIO p j
                       tj <- getIO t j
                       case () of
                        _ | si == pj  -> go (i+1) (j+1)
                          | j == 0    -> go (i+1) j
                          | otherwise -> go i     tj

---------------------------------------------------------------------------
-- | Make Table -----------------------------------------------------------
---------------------------------------------------------------------------

-- BUG WHAT's going on?
{-@ bob :: Nat -> IO () @-}
find p@(IOA m _) s@(IOA n _) t = go
  where
    go i j
      | i >= n    = return $ Nothing
      | j >= m    = return $ Just (i - m)
      | otherwise = do si <- getIO s i
                       pj <- getIO p j
                       tj <- getIO t j
                       case () of
                        _ | si == pj  -> go (i+1) (j+1)
                          | j == 0    -> go (i+1) j
                          | otherwise -> go i     tj

---------------------------------------------------------------------------
-- | Make Table -----------------------------------------------------------
---------------------------------------------------------------------------

-- BUG WHAT's going on?
{-@ bob :: Nat -> IO () @-}