144 points · by agomez314 · 2y ago · 45 comments
three = \f x -> f (f (f x))
fac = \n f -> n (\f n -> n (f (\f x -> n f (f x)))) (\x -> f) (\x -> x)
main = print $ fac three (+ 1) 0 -- works for all 32-bit integers
fac n = [1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600]!!nfac n = (scanl (*) 1 [1..]) !! n
https://drive.google.com/file/d/1lPnQiik5cAx0X2E3GNbw_Oaug87...
I wrote more, but it got too silly.
They post docs.
Sure enough, in the commentary:
> Monads are woefully un-represented here; I would be grateful if someone could contribute a few (progressive) examples in the spirit of the development above.
This is a beautiful line of code.
In all seriousness, I'd probably prefer to find the Junior or "Another junior" version if I was browsing a project.
Why would one assume the invalid certificate is caused by that particular professor instead of the IT department's staff at the University of Calgary?
Also the practical joke is largely independant from haskell. It's pretty much an example of shuhari principles applied.
Yeah, academics are only interested in producing silly papers to justify expensive trips to exotic conference locations.
Meanwhile, industry produces important and useful stuff like Scrum™ Poker-planning estimates and Jira®-powered burndown charts to track completion of their Confluence© fully-documented user-stories.