this post was submitted on 04 Jun 2025
1046 points (98.6% liked)

Programmer Humor

31553 readers
1236 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bss03@infosec.pub 6 points 11 months ago

Oddly enough, in Haskell (as defined by the report), length is monomorphic, so it just doesn't work on tuples (type error).

Due to the way kinds (types of types) work in Haskell, Foldable instances can only operate over (i.e. length only counts) elements of the last/final type argument. So, for (,) it only counts the second part, which is always there exactly once. If you provided a Foldable for (,,,) it would also have length of 1.