Friday, January 8, 2016

NF, HNF and WHNF

WHNF: a lambda expr or a constructor
HNF: a lambda expr where the function body is a NF
NF: a term that contains no beta regex

A discussion in SO about stack overflow is particularly interesting to me. I thought the strict version of foldl evaluates to NF, but it in fact only evaluates to WHNF. This is why summing up tuples doesn't evaluate the components, another thing I misunderstood.