summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/rule1.hs
blob: 47b21c96814409bb36b79c0c1a6e3eb17694f191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

-- This one triggers the bug reported in #1092
-- The problem is that the rule
--      forall w. f (\v->w) = w
-- erroneously matches the call
--      f id
--
-- Lint catches the error

module Foo where

f :: (Int -> Int) -> Int
{-# NOINLINE f #-}
f g = g 4
{-# RULES
  "f" forall w. f (\v->w) = w
 #-}

h = f id