summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/simpl016.hs
blob: 4f371a78f0a5636dad9d9e89d1c0380c4a0ddb1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

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