Vesa Karvonen wrote:
On Dec 26, 2007 5:27 AM, Ian Zimmerman itz@madbat.mine.nu wrote:
I get this:
Exception- Fail "Invalid type (not a type construction)" raised
Who's to "blame"? And is there a workaround?
I took a look at this. I would argue that this is a bug in Poly/ML, although, of course, overloading isn't a part of the Definition, so technically Poly/ML can specify it freely. The problem is around line BinOp.t type constructor to recognize it as an arrow type. You can work around this by ascribing the value explicitly with an arrow type:
RunCall.addOverload (Word32.+ : Word32.t * Word32.t -> Word32.t) "+";
(In your case, of course, you'd do the same for Word31 instead of Word32. You don't need Word31 to expose this problem.)
Since there seems to be a work-around for this problem I don't feel it's worth spending any effort on fixing. If someone wants to provide a patch I'll certainly consider it. The RunCall structure is only intended to be used for writing Poly-specific libraries and not for average users. Some of the functions in it are very unsafe, such as the arbitrary cast, so any use of it is "at user's own risk".
By the way, on all 32-bit platforms other than Sparc Word is actually Word31 so you probably don't need to re-implement it.
David.