ghc-dump-tree 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+37/−12 lines, 3 filesdep ~aesondep ~basedep ~ghcPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, base, ghc, process
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−0
- ghc-dump-tree.cabal +10/−10
- src/Language/Haskell/GHC/DumpTree.hs +22/−2
ChangeLog.md view
@@ -1,3 +1,8 @@+0.2.0.1+-------+* Build with ghc 8.0+* Show nameUnique value for Name+ 0.2.0.0 ------- * Initial Hackage release. Thanks to all contributors (see CONTRIBUTORS)
ghc-dump-tree.cabal view
@@ -1,5 +1,5 @@ name: ghc-dump-tree-version: 0.2.0.0+version: 0.2.0.1 synopsis: Dump GHC's parsed, renamed, and type checked ASTs description: Useful for GHC devs or people who want to do something with GHC's AST but don't want to hook into the GHC API itself.@@ -13,7 +13,7 @@ category: Development build-type: Simple cabal-version: >=1.10-tested-with: GHC==7.4.2, GHC==7.8.3, GHC==7.10.0.20150310+tested-with: GHC==7.4.2, GHC==7.6.3, GHC==7.8.3, GHC==7.10.3, GHC==8.0.0.20160421 extra-source-files: ChangeLog.md@@ -25,13 +25,13 @@ location: https://github.com/edsko/ghc-dump-tree.git library- build-depends: base >=4.5 && <4.9,- aeson >=0.7 && <0.11,+ build-depends: base >=4.5 && <4.10,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11,- ghc >=7.4 && <7.12,+ ghc >=7.4 && <8.2, pretty >=1.1 && <1.2, pretty-show >=1.6 && <1.7,- process >=1.1 && <1.3,+ process >=1.1 && <1.5, unordered-containers >=0.2 && <0.3, vector >=0.10 && <0.12 hs-source-dirs: src@@ -44,14 +44,14 @@ executable ghc-dump-tree main-is: Main.hs- build-depends: base >=4.5 && <4.9,- aeson >=0.7 && <0.11,+ build-depends: base >=4.5 && <4.10,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11,- ghc >=7.4 && <7.12,+ ghc >=7.4 && <8.2, optparse-applicative >=0.11 && <0.13, pretty >=1.1 && <1.2, pretty-show >=1.6 && <1.7,- process >=1.1 && <1.3,+ process >=1.1 && <1.5, unordered-containers >=0.2 && <0.3, vector >=0.10 && <0.12, ghc-dump-tree
src/Language/Haskell/GHC/DumpTree.hs view
@@ -184,11 +184,20 @@ let evBinds = bagToList bagOfEvBind fmap (Con "TcEvBinds") $! mapM prettyEvBind evBinds +#if MIN_VERSION_ghc(8,0,0) prettyEvBind :: GhcMonad m => EvBind -> m Value+prettyEvBind (EvBind var term isGiven) = do+ pVar <- prettyVar var+ pTerm <- pretty' term+ pGiven <- pretty' isGiven+ return $! Rec "" [("ev_var", pVar), ("ev_term", pTerm), ("ev_is_given", pGiven)]+#else+prettyEvBind :: GhcMonad m => EvBind -> m Value prettyEvBind (EvBind var term) = do pVar <- prettyVar var pTerm <- pretty' term return $! Rec "" [("ev_var", pVar), ("ev_term", pTerm)]+#endif prettyRdrName :: GhcMonad m => RdrName -> m Value prettyRdrName (Unqual nm) = prettyOccName nm@@ -207,7 +216,8 @@ Rec "" fields <- prettyOccName (nameOccName nm) loc <- pretty' (nameSrcSpan nm) sort <- prettyNameSort- return $! Rec "" (("n_loc",loc):("n_sort",sort):fields)+ uniq <- pretty' $ nameUnique nm+ return $! Rec "" (("n_loc",loc):("n_sort",sort):("n_uniq",uniq):fields) where prettyNameSort :: GhcMonad m => m Value prettyNameSort@@ -235,7 +245,17 @@ prettyModuleName :: GhcMonad m => ModuleName -> m Value prettyModuleName = return . String . moduleNameString -#if MIN_VERSION_ghc(7,10,0)+#if MIN_VERSION_ghc(8,0,0)+prettyModule :: GhcMonad m => Module -> m Value+prettyModule mod = do+ pkg <- prettyUnitId $ moduleUnitId mod+ nm <- prettyModuleName $ moduleName mod+ return $! Con "Module" [pkg, nm]++prettyUnitId :: GhcMonad m => UnitId -> m Value+prettyUnitId = return . String . unitIdString++#elif MIN_VERSION_ghc(7,10,0) prettyModule :: GhcMonad m => Module -> m Value prettyModule mod = do pkg <- prettyPackageKey $ modulePackageKey mod