Skip to content

Instantly share code, notes, and snippets.

@Fasand
Created October 6, 2016 15:44
Show Gist options
  • Save Fasand/6d64c9b5b0bbc2f09705de8b27d4037b to your computer and use it in GitHub Desktop.
Save Fasand/6d64c9b5b0bbc2f09705de8b27d4037b to your computer and use it in GitHub Desktop.
contains phrase word = word `elem` [take (length word) (drop x phrase) | x <- [0..(length phrase - length word)]]
contains phrase word = True `elem` [word `isPrefixOf` drop n phrase | n <- [0..(length phrase - length word)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment