
12 Dec
2011
12 Dec
'11
10:58 a.m.
Graham Gill
But then we would lose referential transparency.
As I understand, this would be against lazy evaluation since it would request to evaluate expressions in lambda, but I don't see how this relates to referential transparency. Can you elaborate this a little bit?
I second the question.
Referential transparency /requires/ that id x = x even if 'x' is a function, and this can, as Brent already noted, arbitrarily complicated. If pattern matching could tell f from id f, then referential transparency is violated. The only possible way to tell f from id f is very unsafe and needs IO, hence not usable in pattern matching. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/