Today's small haskell satori: the least fixpoint operator
> fix f = let x = f x in x
(which seemed like dark magic when I first saw it) could be written a bit more intuitively as
> fix' f = let f' = f . f' in f' undefined
This captures the intuition that
fix just applies a function
undefined (i.e. bottom,
_|_). Actually we could use
any value in the place of
undefined but that would restrict the type
fix'. You see, the only reason
f' really needs to be applied to
anything is to appease the typechecker.
Of course the original (Haskell98) definition is more elegant and probably has better sharing characteristics too.