Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substring :: String -> [String]
- substring [] = []
- substring xs = subs xs ++ substring (tail xs)
- where
- subs xs = foldl step [] xs
- step [] a = [[a]]
- step acc a = (head acc ++ [a]) : acc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement