Re:Harvard's 1899 Entrance Exam [pdf]
by fhars on Saturday April 09, 2011 @04:51AM
(#2426803)
But to become a fully erudite member of modern society, you might want to also study
:-)
[ Parent
| on HN ]
Allowing one to simplify to:
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
Involving zip`ap`tail, the Aztec god of consecutive numbers: fibs = 1 : 1 : (zipWith (+) `ap` tail) fibs
Or, pointlessly: fix $ (1:) . (1:) . (zipWith (+) `ap` tail)Your second example does not typecheck.
It does.
let fibs = 1 : 1 : (zipWith (+) `ap` tail) fibs in fibs :: (Num a) => [a]
according to ghci 6.12.1