2 ms·
No, you're probably not alone. I myself enjoy functional programming quite a lot but Y combinator always stood out to me as a particularly uninteresting trick.
by Joker_vD 2y ago
No, you're probably not alone. I myself enjoy functional programming quite a lot but Y combinator always stood out to me as a particularly uninteresting trick. Sure, it's nice to have it around when you try to prove some theoretical stuff but for practical work letrec is just better.
I mostly feel the same about the Church encoding of e.g. lists: yeah, it's a nice theoretical trick that you can equate a list xs with a function that gives your its fold but... that's just so inconvenient to actually use! Why not equate it with either a nil or a tuple of head and tail instead?
def empty_list(onEmpty, onNonEmpty):
return onEmpty()
def make_a_non_empty_list(head, tail):
def non_empty_list(onEmpty, onNonEmpty):
return onNonEmpty(head, tail)
return non_empty_list