Re:DBase: 1979-2026
by kccqzy on Monday May 11, 2026 @01:14PM
(#48097756)
Yes! In lazy but immutable languages like Haskell, it is totally fine to refer to the value itself during definition. This is really the same idea that a recursive function can refer to itself during definition. It’s common to define a variable for the infinite list of prime numbers, where the definition requires the list of prime numbers itself.
Here `primes` is a variable that refers to itself in its definition (called corecursion), and `sieve` is a recursive function.
[ Parent
| on HN ]
There are no comments on this comment yet.