View main.hs
module Main where
-- | Return a Knuth-Morris-Pratt index for a given string
stringIndex :: String -> [Int]
stringIndex "" = []
stringIndex txt = indexr [0] 0 1 where
indexr :: [Int] -> Int -> Int -> [Int]
indexr rsf subPos chrPos