Skip to content

Core lint error in simplifier when compiling Rules1 with -O -dcore-lint

Running make TEST=Rules1 WAY=optasm results in a core lint error (see attachment) with ghc-8.0.1-rc2.

This is the code:

{-# LANGUAGE TypeFamilies #-}

module Rules1 where

class C a where
  data T a

instance (C a, C b) => C (a,b) where
  data T (a,b) = TPair (T a) (T b)

mapT :: (C a, C b) => (a -> b) -> T a -> T b
{-# NOINLINE mapT #-}  -- Otherwwise we get a warning from the rule
mapT = undefined

zipT :: (C a, C b) => T a -> T b -> T (a,b)
{-# NOINLINE [1] zipT #-}
zipT = undefined

{-# RULES

"zipT/mapT" forall f x y.
  zipT (mapT f x) y = mapT (\(x,y) -> (f x, y)) (zipT x y)

 #-}
$ ghc-8.0.1 -O Rules1.hs -dcore-lint

This is a regression from 7.10.3, and core lint errors are bad, so setting priority to highest.

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