Comment

Comment by Woost

Would something like the above code be on your interview? (pow = 1 : [ 2*x | x <- pow])

I'd probably fail it even though I do understand recursion. I don't know Haskell, and the above is rather cryptic to me. I can infer that it raises 2 to a power, but I'm not sure how it works -- both in how it's called (does that define a function? Pow(4) --> 16?) and the why (the last part defines the recursion I assume, but what happens when you need multiple args, and what does it mean?)

parent Woost 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton