Commit 01bc1096 authored by niteria's avatar niteria
Browse files

Document zonkTyCoVarsAndFV determinism

I've changed it to use nonDetEltsUFM and documented why
it's OK.

Test Plan: it builds

Reviewers: bgamari, austin, simonmar, goldfire, simonpj

Reviewed By: simonpj

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #4012
parent 69714306
......@@ -108,6 +108,7 @@ import FastString
import SrcLoc
import Bag
import Pair
import UniqFM
import qualified GHC.LanguageExtensions as LangExt
import Control.Monad
......@@ -1230,7 +1231,11 @@ zonkTyCoVar tv | isTcTyVar tv = zonkTcTyVar tv
-- painful to make them into TcTyVars there
zonkTyCoVarsAndFV :: TyCoVarSet -> TcM TyCoVarSet
zonkTyCoVarsAndFV tycovars = tyCoVarsOfTypes <$> mapM zonkTyCoVar (varSetElems tycovars)
zonkTyCoVarsAndFV tycovars =
tyCoVarsOfTypes <$> mapM zonkTyCoVar (nonDetEltsUFM tycovars)
-- It's OK to use nonDetEltsUFM here because we immediately forget about
-- the ordering by turning it into a nondeterministic set and the order
-- of zonking doesn't matter for determinism.
-- Takes a list of TyCoVars, zonks them and returns a
-- deterministically ordered list of their free variables.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment