[bitc-dev] Haskell question: exceptions
Jonathan S. Shapiro
shap at eros-os.org
Thu Aug 11 13:19:27 EDT 2005
Are you able to explain why procedures that throw exceptions are subject
to the value restriction?
Since the receiving variable at the catch block is "initialize once,
then read only", we actually don't need to impose any monomorphism
restriction on that (though this doesn't matter, since we always know
that it is an instance of type Exception).
But I'm confused about why *throwing* an exception should incur a
restriction. It appears to me that there is a simple rewrite into a
program that returns exceptions as variant return values without
otherwise altering mutability anywhere.
What am I missing?
More information about the bitc-dev