Live data from Hacker News

Lambdasort: Quicksort written in Python only using lambdas

lucasoshiro.github.io

11–12 of 12 posts

Re: Lambdasort: Quicksort written in Python only using lambdas

#11
post #8

You can also program in Python just in list comprehensions: https://maximullaris.com/abusing_python.html

Considering that list comprehensions can be replaced by maps and filters, and they can replaced by reduces, maybe we can ever go further in that craziness and do it only using reduces!

Re: Lambdasort: Quicksort written in Python only using lambdas

#12
post #4

A couple of months ago I was playing around with a similar technique, Mogensen-Scott encoding, in typescript. I was mainly interested in it as a way to express sum types without a bunch of if statements (instead a "value" of a type takes functions for each possible case branch and calls the appropriate one). I ended up writing a little dependent type checker: https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67…

Wow, I didn't know about that. Nice to see more things about lambda calculus, I think it is the most beautiful thing in computer science, but I haven't studied it too deeply as I need to prioritize other things...
Post reply on HN