1 {-# LANGUAGE TypeFamilies #-}

3 -- #3346

8 type Result a

12 -- {-# RULES "rule1" forall x. to (from x) = x #-}

13 -- {-# RULES "rule2" forall x. from (to x) = x #-}

16 -- This is typed in a way rather similarly to RULE rule1

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)