Guest User

Untitled

a guest
Feb 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. suche :: String -> String -> Integer
  2. suche haystack needle = suche' (zip [0..] haystack) needle
  3.  
  4. suche' :: [(Integer, Char)] -> String -> Integer
  5. suche' [] needle = -1
  6. suche' ((idx, x):xs) needle
  7.     | (x:map snd (take (length needle - 1) xs)) == needle = idx
  8.     | otherwise = suche' xs needle
Add Comment
Please, Sign In to add comment