Skip to content

Instantly share code, notes, and snippets.

@cppxor2arr
Last active June 19, 2018 12:01
Show Gist options
  • Save cppxor2arr/9d9cb3228a6104f757aed30aa079b7ec to your computer and use it in GitHub Desktop.
Save cppxor2arr/9d9cb3228a6104f757aed30aa079b7ec to your computer and use it in GitHub Desktop.
sequence difference
f :: Num a => [a] -> [a]
f [] = []
f [x] = []
f [x1,x2] = [x2-x1]
f (x1:x2:xs) = x2-x1:f (x2:xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment