New Version of plusAddr and HDirect Conflict
I've just upgraded to 4.08 (because I need to do some profiling) and am in the process of rebuilding HDirect. I'm getting the following Pointer.lhs:103: Couldn't match `AddrOff' against `Int' Expected type: AddrOff Inferred type: Int In the application `toInt i' In the second argument of `plusAddr', namely `(toInt i)' Pointer.lhs:104: Couldn't match `AddrOff' against `Int' Expected type: AddrOff Inferred type: Int In the application `toInt d' In the first argument of `negate', namely `(toInt d)' In the documentation for 4.04: plusAddr :: Addr - Int - Addr Lines 103-4 in Pointer.lhs: ptrInc i p= p `plusAddr` (toInt i) ptrDec d p= p `plusAddr` (-(toInt d)) In the latest documentation: plusAddr :: Addr - AddrOff - Addr Does anyone have any suggestions on what I should do? - 21st century air travel http://www.britishairways.com
Re: New Version of plusAddr and HDirect Conflict
[CC field left intact, despite nonexistant Mail-Followup-To] On Tue, Oct 03, 2000 at 13:52:38 +, Steinitz, Dominic J wrote: Pointer.lhs:103: Couldn't match `AddrOff' against `Int' Expected type: AddrOff Inferred type: Int In the application `toInt i' In the second argument of `plusAddr', namely `(toInt i)' `toInt' is a Glasgow Extension and is considered evil now IIRC (it always was, but there were some efficiency reasons, which are now resolved...) `AddrOff' is instance of `Num', so use `fromIntegral' instead of `toInt'... Cheers, M/ -- () ASCII ribbon campaign | Chair for Computer Science II | GPG: F65C68CD /\ against HTML mail | RWTH Aachen, Germany | PGP: 1D0DD0B9 "I WAS NOT TOLD TO DO THIS" -- Bart Simpson in 5F13