In Lazier functional programming, part 1, I suggested that some of the standard tools of lazy functional programming are not as lazy as they might be, including even
Generalizing from boolean conditionals, I posed the puzzle of how to define a lazier
either function, which encapsulates case analysis for sum types.
The standard definition:
The comments to part 1 fairly quickly converged to something close to the laxer definition I had in mind:
which is a simple generalization of Luke Palmer‘s laxer if-then-else (reconstructed from memory):
bool c a b = (a ⊓ b) ⊔ (if c then a else b)