diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2017-05-24 17:39:06 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2017-06-05 22:26:55 +0200 |
commit | a9f774fa3c12f9b8e093e46d58e7872d3d478951 (patch) | |
tree | dbc13ac0d4a85be03a4d5c4cf7ed213900d9ad24 /haddock-api/src/Haddock/GhcUtils.hs | |
parent | 1e1f85d6513b84bac3ae13470900ac7c23e8640e (diff) |
Rename extension index tags
Diffstat (limited to 'haddock-api/src/Haddock/GhcUtils.hs')
-rw-r--r-- | haddock-api/src/Haddock/GhcUtils.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 16c589f0..83e4dbd8 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -151,7 +151,7 @@ reL = L undefined ------------------------------------------------------------------------------- -instance NamedThing (TyClDecl GHCR) where +instance NamedThing (TyClDecl GhcRn) where getName = tcdName ------------------------------------------------------------------------------- @@ -163,14 +163,14 @@ class Parent a where children :: a -> [Name] -instance Parent (ConDecl GHCR) where +instance Parent (ConDecl GhcRn) where children con = case getConDetails con of RecCon fields -> map (selectorFieldOcc . unL) $ concatMap (cd_fld_names . unL) (unL fields) _ -> [] -instance Parent (TyClDecl GHCR) where +instance Parent (TyClDecl GhcRn) where children d | isDataDecl d = map unL $ concatMap (getConNames . unL) $ (dd_cons . tcdDataDefn) $ d @@ -185,12 +185,12 @@ family :: (NamedThing a, Parent a) => a -> (Name, [Name]) family = getName &&& children -familyConDecl :: ConDecl GHC.GHCR -> [(IdP GHCR, [IdP GHCR])] +familyConDecl :: ConDecl GHC.GhcRn -> [(Name, [Name])] familyConDecl d = zip (map unL (getConNames d)) (repeat $ children d) -- | A mapping from the parent (main-binder) to its children and from each -- child to its grand-children, recursively. -families :: TyClDecl GHCR -> [(IdP GHCR, [IdP GHCR])] +families :: TyClDecl GhcRn -> [(Name, [Name])] families d | isDataDecl d = family d : concatMap (familyConDecl . unL) (dd_cons (tcdDataDefn d)) | isClassDecl d = [family d] @@ -198,12 +198,12 @@ families d -- | A mapping from child to parent -parentMap :: TyClDecl GHCR -> [(IdP GHCR, IdP GHCR)] +parentMap :: TyClDecl GhcRn -> [(Name, Name)] parentMap d = [ (c, p) | (p, cs) <- families d, c <- cs ] -- | The parents of a subordinate in a declaration -parents :: IdP GHCR -> HsDecl GHCR -> [IdP GHCR] +parents :: Name -> HsDecl GhcRn -> [Name] parents n (TyClD d) = [ p | (c, p) <- parentMap d, c == n ] parents _ _ = [] |