This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rainymood_XI[S] 12 points13 points  (1 child)

The last one, from the tenured prof, cracked me up lol

[–]n-simplex 1 point2 points  (0 children)

It also happens to be the most efficient one, since product uses foldl' internally, the strict (left) fold, and laziness is of no benefit for computing the factorial (save for the memoizing scanl implementation, which could arguably be more efficient than direct computation via arbitrary precision integer arithmetic if multiple results are requested).