
4 Mar
2008
4 Mar
'08
11:26 a.m.
Hi
showsType io = showString "(IO " . showsType a . showChar ')' where a = undefined b = asTypeOf (return a) io
That works too, though it still relies on showsType not evaluating it's argument - since otherwise it'll eval undefined :S
Of course, but the advantage is that if it fails to work the side effect is _|_, rather than (potentially) rooting your computer. I'm thinking for the day when we have yhi --safe to not run IO computations. i.e. showType (deleteFile "/usr/shackell/thesis.tex") :-) Thanks Neil