summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/simpl016.hs
blob: 6ba088e6fa5603f025be242da2d44c9ae9fd3fe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
-- Test for trac ticket #1287; ghc 6.6 and 6.6.1 panicked on this

module ShouldCompile where

{-# SPECIALIZE delta' :: Num b => Int -> Int -> b -> b -> b #-}
delta' :: Eq a => a -> a -> b -> b -> b
delta' x y e f = if (x==y) then f else e

{-# SPECIALIZE delta :: Num b => Int -> Int -> b #-}
delta :: (Eq a, Num b) => a -> a -> b
delta x y = delta' x y 0 1