
16 Jul
2009
16 Jul
'09
2:40 p.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.