summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc207.hs
blob: 9f5a04a42d3d4604279e209be18fe735cb5c5704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

-- Tests enhanced polymorphism

module ShouldCompile where

foo xs = let
           f :: Eq a => [a] -> [a]
           f [] = []
           f xs | null (g [True]) = []
                | otherwise       = tail (g xs)

           g :: Eq b => [b] -> [b]
           g [] = []
           g xs | null (f "hello") = []
                | otherwise       = tail (f xs)
        in f xs