Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created November 22, 2013 06:12
Show Gist options
  • Save qoelet/7595605 to your computer and use it in GitHub Desktop.
Save qoelet/7595605 to your computer and use it in GitHub Desktop.
-- Specifying lag = n
diff :: (Num a) => [a] -> Int -> [a]
diff [] n = []
diff (x:xs) n | length (xs) > n = (xs!!n - x) : diff xs n
| otherwise = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment