Thursday, March 26, 2026

Pierce's Law in Egel

Like Scheme, Egel has a trivial inhabitant of Pierce's Law ((p->q)->p)->p too.

def pierce = [F -> try F [X -> throw X] catch [X -> X]]

The combinator pierce has Pierce's law as type and takes as an argument a function F of type (p->q)->p and we feed that function another function of type p->q that throws its argument X of type p to the outer scope.

Utter bullshit, of course.

No comments:

Post a Comment