fork download
  1. minus xs [] = xs
  2. minus [] ys = map negate ys
  3. minus (x:xs) (y:ys) = x-y : minus xs ys
  4.  
  5. der [] = []
  6. der (_:xs) = minus ys (0:0:ys)
  7. where ys = zipWith (*) [1..] xs
  8.  
  9. main = mapM_ print $ take 10 $ iterate der [0,1]
Success #stdin #stdout 0.01s 5448KB
stdin
Standard input is empty
stdout
[0,1]
[1,0,-1]
[0,-2,0,2]
[-2,0,8,0,-6]
[0,16,0,-40,0,24]
[16,0,-136,0,240,0,-120]
[0,-272,0,1232,0,-1680,0,720]
[-272,0,3968,0,-12096,0,13440,0,-5040]
[0,7936,0,-56320,0,129024,0,-120960,0,40320]
[7936,0,-176896,0,814080,0,-1491840,0,1209600,0,-362880]