this post was submitted on 14 Feb 2024
540 points (96.7% liked)

Programmer Humor

19370 readers
48 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
540
??? (lemm.ee)
submitted 8 months ago* (last edited 5 months ago) by [email protected] to c/programmer_humor
 
you are viewing a single comment's thread
view the rest of the comments
[–] PoolloverNathan 1 points 8 months ago

Haskell lets you infinitely recurse while still completing in finite time, and there's even a function (fix) for that. Doing e.g. fix (+ 2) would be an infinite loop if evaluated, yes, but fix (2 :) would give you a useful value that's an infinite stream of 2s. (it's also useful for other things too)