
26 Mar
2009
26 Mar
'09
11:52 a.m.
On Thu, 26 Mar 2009, Xiao-Yong Jin wrote:
So I have another question. Is the following function safe and legitimate?
safeDiv :: (Exception e, Integral a) => a -> a -> Either e a safeDiv x y = unsafePerformIO . try . evaluate $ div x y
I believe it should be okay to use this 'safeDiv'. What do
I think that question is wrong way around. The real question is, why do you want to solve your problem using unsafePerformIO?