summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc111.hs
blob: 440fd05714d118ffb51409bbf08bd4abefb1a869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

-- !!! Test monomorphism + RULES

module ShouldCompile where

-- This example crashed GHC 4.08.1.
-- The reason was that foobar is monomorphic, so the RULE 
-- should not generalise over it.

{-# NOINLINE [1] foo #-}
foo 1 = 2
{-# NOINLINE [1] bar #-}
bar 0 = 1

foobar = 2

{-# RULES
  "foo/bar" foo bar = foobar
 #-}