{-@ type Upto N = {v:Nat | v < N} @-}

---------------------------------------------------------------------------
{-@ search :: pat:String -> str:String -> IO (Maybe (Upto (len str))) @-}
---------------------------------------------------------------------------
search :: String -> String -> IO (Maybe Int)
search pat str = do
  p <- ofListIO pat
  s <- ofListIO str
  kmpSearch p s

---------------------------------------------------------------------------
-- | Do the Search --------------------------------------------------------
---------------------------------------------------------------------------
search :: String -> String -> IO (Maybe Int)
search pat str = do
  p <- ofListIO pat
  s <- ofListIO str
  kmpSearch p s

---------------------------------------------------------------------------
-- | Do the Search --------------------------------------------------------
---------------------------------------------------------------------------
search pat str = do
  p <- ofListIO pat
  s <- ofListIO str
  kmpSearch p s

---------------------------------------------------------------------------
-- | Do the Search --------------------------------------------------------
---------------------------------------------------------------------------