1 {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, TypeFamilies #-}

5 type family F a

14 -- This example demonstrates why we need to push in

15 -- an unsolved wanted as a given and not a given/solved.

16 -- [Wanted] F Int ~ [beta]

17 --- forall a. F Int ~ [a] => a ~ beta

18 -- We push in the [Wanted] as given, it will interact and solve the implication

19 -- constraint, and finally we quantify over F Int ~ [beta]. If we push it in as

20 -- Given/Solved, it will be discarded when we meet the given (F Int ~ [a]) and

21 -- we will not be able to solve the implication constraint.

23 -- Oct 14: actually this example is _really_ strange, and doesn't illustrate

24 -- the real issue in #4935, for which there is a separate test

25 --

26 -- The example here requires us to infer a type

27 -- bar :: F Int ~ [a] => ...

28 -- which is a strange type to quantify over; better to complain about

29 -- having no instance for F Int.