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
main :: IO()
main = do
print . f $ map sqrt [1..20]
f :: Num a => [a] -> [a]
f [x1,x2] = [x2-x1]
f (x1:x2:xs) = x2-x1:f (x2:xs)
f _ = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment