diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-11-21 15:50:15 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-11-21 15:50:15 -0500 |
commit | be45ddae4e2f7d971f2166d9a8fe45402ddcb3c1 (patch) | |
tree | 26c5f70eb323acac0eb125025fc1f44f0e27e96d /haddock-api/src/Haddock/Interface/Specialize.hs | |
parent | c3f8a3b396e0051133120d2381e73af8cf9c8951 (diff) |
Revert "Match Trees That Grow"
This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c.
Diffstat (limited to 'haddock-api/src/Haddock/Interface/Specialize.hs')
-rw-r--r-- | haddock-api/src/Haddock/Interface/Specialize.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Interface/Specialize.hs b/haddock-api/src/Haddock/Interface/Specialize.hs index f0cf08a1..0cac818d 100644 --- a/haddock-api/src/Haddock/Interface/Specialize.hs +++ b/haddock-api/src/Haddock/Interface/Specialize.hs @@ -203,11 +203,12 @@ setInternalOccName occ name = -- | Compute set of free variables of given type. -freeVariables :: HsType GhcRn -> Set Name +freeVariables :: forall p. (NamedThing (IdP p), DataId p, Typeable p) + => HsType p -> Set Name freeVariables = everythingWithState Set.empty Set.union query where - query term ctx = case cast term :: Maybe (HsType GhcRn) of + query term ctx = case cast term :: Maybe (HsType p) of Just (HsForAllTy _ bndrs _) -> (Set.empty, Set.union ctx (bndrsNames bndrs)) Just (HsTyVar _ _ (L _ name)) |