Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / typecheck / should_compile / T3346.hs
1 {-# LANGUAGE TypeFamilies #-}
2
3 -- #3346
4
5 module Foo where
6
7 class EP a where
8 type Result a
9 from :: a -> Result a
10 to :: Result a -> a
11
12 -- {-# RULES "rule1" forall x. to (from x) = x #-}
13 -- {-# RULES "rule2" forall x. from (to x) = x #-}
14
15 foo :: EP a => a -> a
16 -- This is typed in a way rather similarly to RULE rule1
17 foo x = to (from x)
18
19 -- 'bar' has an ambiguous type and is rightly rejected
20 -- bar :: forall a. Result a -> Result a
21 -- bar x = from (to x :: a)