17 Jul
2009
17 Jul
'09
12:10 a.m.
Consider the following expression:
(foo True, foo 'x')
Is this expression well-typed?
Astonishingly, the answer depends on where "foo" is defined. If "foo" is a local variable, then the above expression is guaranteed to be ill-typed. However, if we have (for example)
That's not true: main = let foo x = x in print (foo True, foo 'x') works like a charm.