blob: e346ab84f68dfe4f636eae51dcf0e30389cc46d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
{-# LANGUAGE GADTs, ExplicitForAll #-}
module Main (main) where
import GHC.Exts
newtype Age a b where
Age :: forall b a. Int -> Age a b
data T a = MkT a
{-# NOINLINE foo #-}
foo :: (Int -> Age Bool Char) -> String
foo _ = "bad (RULE should have fired)"
{-# RULES "foo/coerce" [1] foo coerce = "good" #-}
main = putStrLn (foo Age)
|