Skip to content

Instantly share code, notes, and snippets.

@tomjakubowski
Created November 23, 2012 23:45
Show Gist options
  • Save tomjakubowski/4137736 to your computer and use it in GitHub Desktop.
Save tomjakubowski/4137736 to your computer and use it in GitHub Desktop.
motifs :: Int -> [a] -> [[a]]
motifs _ [] = []
motifs n s@(b:bs)
| (length s >= n) = (take n s):(motifs n bs)
| otherwise = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment