@@ -2089,19 +2089,19 @@ elabInstance info syn what fc cs n ps t expn ds = do
20892089
20902090 -- Bring variables in instance head into scope
20912091 ist <- getIState
2092− let headVars = mapMaybe (\p -> case p of
2093− PRef _ n ->
2094− case lookupTy n (tt_ctxt ist) of
2095− [] -> Just n
2096− _ -> Nothing
2097− _ -> Nothing) ps
2092+ let headVars = nub $ mapMaybe (\p -> case p of
2093+ PRef _ n ->
2094+ case lookupTy n (tt_ctxt ist) of
2095+ [] -> Just n
2096+ _ -> Nothing
2097+ _ -> Nothing) ps
20982098-- let lhs = PRef fc iname
20992099 let lhs = PApp fc (PRef fc iname)
21002100 (map (\n -> pimp n (PRef fc n) True) headVars)
21012101 let rhs = PApp fc (PRef fc (instanceName ci))
21022102 (map (pexp . mkMethApp) mtys)
21032103
2104− logLvl 5 $ "Instance LHS " ++ show lhs
2104+ logLvl 5 $ "Instance LHS " ++ show lhs ++ " " ++ show headVars
21052105 logLvl 5 $ "Instance RHS " ++ show rhs
21062106
21072107 let idecls = [PClauses fc [Dictionary] iname