Tidy up the interface to lookupInstEnv
authorsimonpj@microsoft.com <unknown>
Wed, 9 May 2007 11:25:30 +0000 (11:25 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 9 May 2007 11:25:30 +0000 (11:25 +0000)
commit2c8701fbebc0a6a49248392b53d977f0afdea4ec
treebfc3430afd0863c92e0cf9f053ee776e8385d4ca
parent65b5fb0ff8dd2af5c8bed6db5f059b4f60eb05de
Tidy up the interface to lookupInstEnv

This patch changes the interface to lookupInstEnv, so that it
returns a pair (Instance, [Either TyVar Type])
rather than    (Inst,     TvSubst)

There is no functionality change, but the interface is tidier,
and closer to lookupFamInstEnv (when Manuel has changed that too).
The [Either TyVar Type] gives the type(s) at which the dfun should
be instantiated.  We need an Either because it might be instantiated
freely: see Note [InstTypes: instantiating types] in InstEnv.

(This might be a pattern we want to use elsewhere too.)
compiler/typecheck/Inst.lhs
compiler/typecheck/TcSimplify.lhs
compiler/types/InstEnv.lhs
compiler/utils/Outputable.lhs