Skip to content

Lint failure in GHC 7.6.1

José Romildo Malaquias reports that the attached file (requires parsec unfortunately) makes GHC 7.6.1 give a Lint error:

bash-3.1$ c:/fp/ghc-7.6.1/bin/ghc -c applicative-eval.hs  -dcore-lint -fforce-recomp
*** Core Lint errors : in result of Desugar (after optimization) ***
<no location info>: Warning:
    In a case alternative: (Main.Cte i_ayo :: GHC.Integer.Type.Integer)
    Type of case alternatives not the same as the annotation on case:
        Main.Memory -> GHC.Integer.Type.Integer
        (->) Main.Memory GHC.Integer.Type.Integer
        Control.Applicative.pure
          @ ((->) Main.Memory)
          $dApplicative_a1b4
          @ GHC.Integer.Type.Integer
          i_ayo
*** Offending Program ***
....

However HEAD compiles it just fine.

Sjoerd Visser found that you can avoid the error by replacing

  eval :: Exp -> (->) Memory Integer

with

  eval :: Exp -> Memory -> Integer

which should be the same, but apparently isn't internally in GHC.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information