News for hackers. Stuff that matters.
Re:Harvard's 1899 Entrance Exam [pdf] by schrototo on Saturday April 09, 2011 @03:50AM (#2426739)
Like all tests, it's not hard if you know the stuff that's asked. If you've studied ancient greek in school, that part of the test is probably as easy for you as the algebra part must seem to anyone who went to school in the past couple of decades (it looks about as hard as math homework from when I was 15 or so).

edit:

It's interesting. I do have a certain romantic attachment to this kind of classic humanist education, e.g. it irks me that the history and geography section has me floundered and I'm somewhat sorry that I didn't have the drive to do better in Latin in school.

But then I think, there's so much other interesting things to know and experience. At times when I wish I could read Cicero's Orationes In Catilinam in its original form, I need to remind myself that I can read and understand, say, this little piece of genius:

  fib = 1 : 1 : [ a+b | (a,b) <- zip fib (tail fib) ]
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

  zipWith :: (a-> b -> c) -> [a] -> [b] -> [c]
:-)
Re:Harvard's 1899 Entrance Exam [pdf] by aristidb on Saturday April 09, 2011 @06:14AM (#2426900)
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)
Re:Harvard's 1899 Entrance Exam [pdf] by ahh on Saturday April 09, 2011 @09:07PM (#2428542)
Your second example does not typecheck.
Re:Harvard's 1899 Entrance Exam [pdf] by aristidb on Sunday April 10, 2011 @09:18PM (#2430929)
It does.

let fibs = 1 : 1 : (zipWith (+) `ap` tail) fibs in fibs :: (Num a) => [a]

according to ghci 6.12.1

Re:Harvard's 1899 Entrance Exam [pdf] by ahh on Wednesday April 13, 2011 @12:06AM (#2440711)
I get No instance for (Monad ((->) [a])) -am I missing some module include?