Dear Bjorn,

Attached is a patch that fixes a context reduction stack overflow in
your dimensional package.

I noticed something weird though (that's why I'm CCing the ghc list).
When I cabal build dimensional-0.8.2 I first get the context reduction
stack overflow when I then build it again I get the error again (as
expected). However when I try to build it for the third time it
succeeds! Why is this?

I attached the build log.

Regards,

Bas

Attachment: fix-context-reduction-stack-overflow.dpatch
Description: Binary data

bas@pcbas:~/Downloads/dimensional$ cabal clean
cleaning...
bas@pcbas:~/Downloads/dimensional$ cabal configure
Resolving dependencies...
Configuring dimensional-0.8.2...
bas@pcbas:~/Downloads/dimensional$ cabal build
Preprocessing library dimensional-0.8.2...
Building dimensional-0.8.2...
[1 of 7] Compiling Numeric.Units.Dimensional ( Numeric/Units/Dimensional.lhs, dist/build/Numeric/Units/Dimensional.o )
[2 of 7] Compiling Numeric.Units.Dimensional.Quantities ( Numeric/Units/Dimensional/Quantities.lhs, dist/build/Numeric/Units/Dimensional/Quantities.o )
[3 of 7] Compiling Numeric.Units.Dimensional.SIUnits ( Numeric/Units/Dimensional/SIUnits.lhs, dist/build/Numeric/Units/Dimensional/SIUnits.o )
[4 of 7] Compiling Numeric.Units.Dimensional.Prelude ( Numeric/Units/Dimensional/Prelude.hs, dist/build/Numeric/Units/Dimensional/Prelude.o )
[5 of 7] Compiling Numeric.Units.Dimensional.NonSI ( Numeric/Units/Dimensional/NonSI.lhs, dist/build/Numeric/Units/Dimensional/NonSI.o )
[6 of 7] Compiling Numeric.Units.Dimensional.Extensible ( Numeric/Units/Dimensional/Extensible.lhs, dist/build/Numeric/Units/Dimensional/Extensible.o )
[7 of 7] Compiling Numeric.Units.Dimensional.CGS ( Numeric/Units/Dimensional/CGS.lhs, dist/build/Numeric/Units/Dimensional/CGS.o )

Numeric/Units/Dimensional/CGS.lhs:304:11:
    Context reduction stack overflow; size = 21
    Use -fcontext-stack=N to increase stack size to N
      $dSucc :: N.Succ t'0 (N.Pos Zero)
      co :: a' ~ N.Pos Zero
      $dSucc :: N.Succ a' (N.Pos (N.Pos Zero))
      co :: a'1 ~ N.Pos (N.Pos Zero)
      $dSucc :: N.Succ a'1 (N.Pos (N.Pos (N.Pos Zero)))
      co :: a'2 ~ N.Pos (N.Pos (N.Pos Zero))
      $dSucc :: N.Succ a'2 (N.Pos Pos3)
      co :: a'3 ~ N.Pos Pos3
      $dSub :: Numeric.NumType.Sub a'3 Zero (N.Pos Pos3)
      co :: a1 ~ Zero
      $dNegate :: N.Negate a1 Zero
      co :: n'' ~ Zero
      $dDiv :: N.Div n'' (N.Pos (N.Pos Zero)) Zero
      co :: a ~ Zero
      $dNegate :: N.Negate a Zero
      $dNegate :: N.Negate (N.Pos a) (N.Neg Zero)
      $dNegate :: N.Negate p'' (N.Neg Zero)
      $dNegate :: N.Negate (N.Pos p'') (N.Neg (N.Neg Zero))
      $dDiv :: N.Div (N.Neg n) (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dDiv :: N.Div it0 (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dMul :: N.Mul Neg2 Pos2 it0
    In the expression: fromSI c
    In an equation for `c_cgs': c_cgs = fromSI c

Numeric/Units/Dimensional/CGS.lhs:305:11:
    Context reduction stack overflow; size = 21
    Use -fcontext-stack=N to increase stack size to N
      $dSucc :: N.Succ c (N.Pos Zero)
      co :: a' ~ N.Pos Zero
      $dSucc :: N.Succ a' (N.Pos Pos1)
      co :: a'1 ~ N.Pos Pos1
      $dSucc :: N.Succ a'1 (N.Pos Pos2)
      co :: a'2 ~ N.Pos Pos2
      $dSucc :: N.Succ a'2 (N.Pos Pos3)
      co :: a'3 ~ N.Pos Pos3
      $dSub :: Numeric.NumType.Sub a'3 Zero (N.Pos Pos3)
      co :: a1 ~ Zero
      $dNegate :: N.Negate a1 Zero
      co :: n'' ~ Zero
      $dDiv :: N.Div n'' (N.Pos (N.Pos Zero)) Zero
      co :: a ~ Zero
      $dNegate :: N.Negate a Zero
      $dNegate :: N.Negate (N.Pos a) (N.Neg Zero)
      $dNegate :: N.Negate p'' (N.Neg Zero)
      $dNegate :: N.Negate (N.Pos p'') (N.Neg (N.Neg Zero))
      $dDiv :: N.Div (N.Neg n) (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dDiv :: N.Div it0 (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dMul :: N.Mul Neg2 Pos2 it0
    In the expression: toSI c_cgs :: Capacitance Double
    In an equation for `c'': c' = toSI c_cgs :: Capacitance Double
bas@pcbas:~/Downloads/dimensional$ cabal build
Preprocessing library dimensional-0.8.2...
Building dimensional-0.8.2...
[7 of 7] Compiling Numeric.Units.Dimensional.CGS ( Numeric/Units/Dimensional/CGS.lhs, dist/build/Numeric/Units/Dimensional/CGS.o )
[1 of 7] Compiling Numeric.Units.Dimensional ( Numeric/Units/Dimensional.lhs, dist/build/Numeric/Units/Dimensional.p_o )
[2 of 7] Compiling Numeric.Units.Dimensional.Quantities ( Numeric/Units/Dimensional/Quantities.lhs, dist/build/Numeric/Units/Dimensional/Quantities.p_o )
[3 of 7] Compiling Numeric.Units.Dimensional.SIUnits ( Numeric/Units/Dimensional/SIUnits.lhs, dist/build/Numeric/Units/Dimensional/SIUnits.p_o )
[4 of 7] Compiling Numeric.Units.Dimensional.Prelude ( Numeric/Units/Dimensional/Prelude.hs, dist/build/Numeric/Units/Dimensional/Prelude.p_o )
[5 of 7] Compiling Numeric.Units.Dimensional.NonSI ( Numeric/Units/Dimensional/NonSI.lhs, dist/build/Numeric/Units/Dimensional/NonSI.p_o )
[6 of 7] Compiling Numeric.Units.Dimensional.Extensible ( Numeric/Units/Dimensional/Extensible.lhs, dist/build/Numeric/Units/Dimensional/Extensible.p_o )
[7 of 7] Compiling Numeric.Units.Dimensional.CGS ( Numeric/Units/Dimensional/CGS.lhs, dist/build/Numeric/Units/Dimensional/CGS.p_o )

Numeric/Units/Dimensional/CGS.lhs:304:11:
    Context reduction stack overflow; size = 21
    Use -fcontext-stack=N to increase stack size to N
      $dSucc :: N.Succ t'0 (N.Pos Zero)
      co :: a' ~ N.Pos Zero
      $dSucc :: N.Succ a' (N.Pos (N.Pos Zero))
      co :: a'1 ~ N.Pos (N.Pos Zero)
      $dSucc :: N.Succ a'1 (N.Pos (N.Pos (N.Pos Zero)))
      co :: a'2 ~ N.Pos (N.Pos (N.Pos Zero))
      $dSucc :: N.Succ a'2 (N.Pos Pos3)
      co :: a'3 ~ N.Pos Pos3
      $dSub :: Numeric.NumType.Sub a'3 Zero (N.Pos Pos3)
      co :: a1 ~ Zero
      $dNegate :: N.Negate a1 Zero
      co :: n'' ~ Zero
      $dDiv :: N.Div n'' (N.Pos (N.Pos Zero)) Zero
      co :: a ~ Zero
      $dNegate :: N.Negate a Zero
      $dNegate :: N.Negate (N.Pos a) (N.Neg Zero)
      $dNegate :: N.Negate p'' (N.Neg Zero)
      $dNegate :: N.Negate (N.Pos p'') (N.Neg (N.Neg Zero))
      $dDiv :: N.Div (N.Neg n) (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dDiv :: N.Div it0 (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dMul :: N.Mul Neg2 Pos2 it0
    In the expression: fromSI c
    In an equation for `c_cgs': c_cgs = fromSI c

Numeric/Units/Dimensional/CGS.lhs:305:11:
    Context reduction stack overflow; size = 21
    Use -fcontext-stack=N to increase stack size to N
      $dSucc :: N.Succ c (N.Pos Zero)
      co :: a' ~ N.Pos Zero
      $dSucc :: N.Succ a' (N.Pos Pos1)
      co :: a'1 ~ N.Pos Pos1
      $dSucc :: N.Succ a'1 (N.Pos Pos2)
      co :: a'2 ~ N.Pos Pos2
      $dSucc :: N.Succ a'2 (N.Pos Pos3)
      co :: a'3 ~ N.Pos Pos3
      $dSub :: Numeric.NumType.Sub a'3 Zero (N.Pos Pos3)
      co :: a1 ~ Zero
      $dNegate :: N.Negate a1 Zero
      co :: n'' ~ Zero
      $dDiv :: N.Div n'' (N.Pos (N.Pos Zero)) Zero
      co :: a ~ Zero
      $dNegate :: N.Negate a Zero
      $dNegate :: N.Negate (N.Pos a) (N.Neg Zero)
      $dNegate :: N.Negate p'' (N.Neg Zero)
      $dNegate :: N.Negate (N.Pos p'') (N.Neg (N.Neg Zero))
      $dDiv :: N.Div (N.Neg n) (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dDiv :: N.Div it0 (N.Pos (N.Pos Zero)) (N.Neg Neg1)
      $dMul :: N.Mul Neg2 Pos2 it0
    In the expression: toSI c_cgs :: Capacitance Double
    In an equation for `c'': c' = toSI c_cgs :: Capacitance Double
bas@pcbas:~/Downloads/dimensional$ cabal build
Preprocessing library dimensional-0.8.2...
Building dimensional-0.8.2...
[7 of 7] Compiling Numeric.Units.Dimensional.CGS ( Numeric/Units/Dimensional/CGS.lhs, dist/build/Numeric/Units/Dimensional/CGS.p_o )
Registering dimensional-0.8.2...
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to