hat error with HUnit: Variable not in scope: `TPrelude.fnegate'

I'm using HUnit (http://hunit.sf.net/) I think the snegate, gnegate, and pnegate are type specialized tracing functions. Hat can't find fnegate, and the source before rewriting points to a handle, stdout I think. Or maybe I'm just missing something? Here's the error: shae@thunderbird:..tedHaskell/TwistedHaskell > hmake -ghc -hat -package data -package hat -i/home/shae/src/haskell/libraries -i/home/shae/build/haskell/hat/hat-2.00/src/hat/lib Test_Banana.hs hat-trans /home/shae/src/haskell/libraries/HUnitText.lhs Wrote /home/shae/src/haskell/libraries/THUnitText.hs ghc -package data -package hat -i/home/shae/src/haskell/libraries -i/home/shae/build/haskell/hat/hat-2.00/src/hat/lib -c -package hat -o /home/shae/src/haskell/libraries/THUnitText.o /home/shae/src/haskell/libraries/THUnitText.hs /home/shae/src/haskell/libraries/THUnitText.hs:64: Variable not in scope: `TPrelude.fnegate' zsh: exit 1 hmake -ghc -hat -package data -package hat -i/home/shae/src/haskell/libraries -- Shae Matijs Erisson - http://www.webwitches.com/~shae/ <radix> shapr: I think you *are* a purist :) <radix> shapr: it's just that you're morally against unstable software, instead of morally against MS, or non-free software, or whatnot.

Shae Matijs Erisson
I'm using HUnit (http://hunit.sf.net/)
/home/shae/src/haskell/libraries/THUnitText.hs:64: Variable not in scope: `TPrelude.fnegate'
The problem here is with hat-trans - in the following definition, put line pers (-1) = do ...; return (-1) it has mistakenly interpreted the negative number literal on the left hand side as a variable binding for negate. Hence, in the transformed version of the code, it has used the lambda-bound form `fnegate' on the right, instead of the real let-bound variable `gnegate'. Until we can find a fix for hat-trans, here is a workaround for your application. Replace the negative numeric literal pattern with another form, such as a guard. For instance: --- HUnitText.lhs Thu Feb 21 20:21:13 2002 +++ HUnitText.lhs.new Fri Jul 26 10:43:40 2002 @@ -55,7 +55,8 @@
putTextToHandle handle showProgress = PutText put initCnt where initCnt = if showProgress then 0 else -1 -> put line pers (-1) = do when pers (hPutStrLn handle line); return (-1) +> put line pers cnt | cnt == (-1) +> = do when pers (hPutStrLn handle line); return (-1) put line True cnt = do hPutStrLn handle (erase cnt ++ line); return 0 put line False cnt = do hPutStr handle ('\r' : line); return (length line) -- The "erasing" strategy with a single '\r' relies on the fact that the
Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Shae Matijs Erisson