summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/tc111.hs
blob: 26eb9429707fab7acda07530fd36d37943cf441e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

-- !!! 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.

foo 1 = 2
bar 0 = 1

foobar = 2

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