packages feed

hint 0.8.0 → 0.9.0

raw patch · 11 files changed

+27/−28 lines, 11 filesdep ~ghcPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ghc

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+### 0.9.0++* Support GHC 8.6+* Drop support for GHC 8.0+ ### 0.8.0  * Support GHC 8.4
README.md view
@@ -1,6 +1,6 @@ # hint -[![Build Status](https://travis-ci.org/mvdan/hint.svg?branch=master)](https://travis-ci.org/mvdan/hint)+[![Build Status](https://travis-ci.com/haskell-hint/hint.svg?branch=master)](https://travis-ci.com/haskell-hint/hint) [![Hackage](https://img.shields.io/hackage/v/hint.svg)](https://hackage.haskell.org/package/hint)  This library defines an Interpreter monad. It allows to load Haskell@@ -12,8 +12,8 @@ API.  Compatibility is kept with the three last major GHC releases. For-example, if the current version is GHC 8.4, Hint will work on 8.4, 8.2-and 8.0.+example, if the current version is GHC 8.6, Hint will work on 8.6, 8.4+and 8.2.  ### Example 
hint.cabal view
@@ -1,5 +1,5 @@ name:         hint-version:      0.8.0+version:      0.9.0 description:         This library defines an Interpreter monad. It allows to load Haskell         modules, browse them, type-check and evaluate strings with Haskell@@ -15,7 +15,7 @@ license-file: LICENSE author:       The Hint Authors maintainer:   mvdan@mvdan.cc-homepage:     https://github.com/mvdan/hint+homepage:     https://github.com/haskell-hint/hint  cabal-version: >= 1.9.2 build-type:    Simple@@ -28,7 +28,7 @@  source-repository head   type:     git-  location: https://github.com/mvdan/hint+  location: https://github.com/haskell-hint/hint  test-suite unit-tests   type:           exitcode-stdio-1.0@@ -51,7 +51,7 @@  library   build-depends: base == 4.*,-                 ghc >= 8.0 && < 8.6,+                 ghc >= 8.2 && < 8.8,                  ghc-paths,                  ghc-boot,                  mtl,@@ -60,7 +60,7 @@                  random,                  directory -  if impl(ghc >= 8.4 && < 8.6) {+  if impl(ghc >= 8.4 && < 8.8) {       build-depends: temporary       cpp-options: -DNEED_PHANTOM_DIRECTORY   }
src/Control/Monad/Ghc.hs view
@@ -76,8 +76,8 @@         unwrap m = unMTLA . GHC.unGhcT (unGhcT m)  instance (MonadIO m, MonadCatch m, MonadMask m) => GHC.ExceptionMonad (GhcT m) where-    gcatch  = catch-    gmask f = mask (\x -> f x)+    gcatch = catch+    gmask  = mask  instance (Functor m, MonadIO m, MonadCatch m, MonadMask m) => GHC.GhcMonad (GhcT m) where     getSession = GhcT GHC.getSession
src/Hint/Annotations.hs view
@@ -3,7 +3,6 @@     getValAnnotations ) where -import Control.Monad import Data.Data import Annotations import GHC.Serialized@@ -15,7 +14,7 @@ -- Get the annotations associated with a particular module. getModuleAnnotations :: (Data a, MonadInterpreter m) => a -> String -> m [a] getModuleAnnotations _ x = do-    mods <- liftM (GHC.mgModSummaries . hsc_mod_graph) $ runGhc GHC.getSession+    mods <- fmap (GHC.mgModSummaries . hsc_mod_graph) $ runGhc GHC.getSession     let x' = filter ((==) x . GHC.moduleNameString . GHC.moduleName . ms_mod) mods     v <- mapM (anns . ModuleTarget . ms_mod) x'     return $ concat v
src/Hint/Base.hs view
@@ -32,9 +32,9 @@  -- | Version of the underlying ghc api. Values are: ----- * @802@ for GHC 8.2.x--- -- * @804@ for GHC 8.4.x+--+-- * @806@ for GHC 8.6.x -- -- * etc... ghcVersion :: Int
src/Hint/Context.hs view
@@ -75,7 +75,7 @@                          setGhcOption $ "-i" ++ fp                          return fp #else-    do liftIO getTemporaryDirectory+    liftIO getTemporaryDirectory #endif  allModulesInContext :: MonadInterpreter m => m ([ModuleName], [ModuleName])@@ -179,8 +179,8 @@        onState (\s -> s{activePhantoms = filter (pm /=) $ activePhantoms s})        --        if safeToRemove-         then do mayFail $ do res <- runGhc1 GHC.load GHC.LoadAllTargets-                              return $ guard (isSucceeded res) >> Just ()+         then mayFail $ do res <- runGhc1 GHC.load GHC.LoadAllTargets+                           return $ guard (isSucceeded res) >> Just ()               `finally` do liftIO $ removeFile (pmFile pm)          else onState (\s -> s{zombiePhantoms = pm:zombiePhantoms s}) @@ -269,7 +269,7 @@        ms_mods <- mapM findModule (nub $ ms ++ map pmName active_pms)        --        let mod_is_interpr = runGhc1 GHC.moduleIsInterpreted-       not_interpreted <- filterM (liftM not . mod_is_interpr) ms_mods+       not_interpreted <- filterM (fmap not . mod_is_interpr) ms_mods        unless (null not_interpreted) $          throwM $ NotAllowed ("These modules are not interpreted:\n" ++                               unlines (map moduleToString not_interpreted))
src/Hint/Internal.hs view
@@ -10,11 +10,11 @@ -- scratch if said wheel is already invented. -- -- In case you find something here especially useful, please submit--- an issue or a pull request at https://github.com/mvdan/hint so+-- an issue or a pull request at https://github.com/haskell-hint/hint so -- we can discuss making it part of the official public API. -- -- Some further context can be found here:--- https://github.com/mvdan/hint/pull/48#issuecomment-358722638+-- https://github.com/haskell-hint/hint/pull/48#issuecomment-358722638   
src/Hint/InterpreterT.hs view
@@ -128,8 +128,7 @@        execute libdir s (initialize args >> action `finally` cleanSession)     where rethrowGhcException   = throwM . GhcException . showGhcEx           newInterpreterSession = newSessionData ()-          cleanSession =-               do cleanPhantomModules+          cleanSession = cleanPhantomModules  {-# NOINLINE uniqueToken #-} uniqueToken :: MVar ()@@ -192,7 +191,7 @@ -- The MonadInterpreter instance  instance (MonadIO m, MonadMask m, Functor m) => MonadInterpreter (InterpreterT m) where-    fromSession f = InterpreterT $ fmap f ask+    fromSession f = InterpreterT $ asks f     --     modifySessionRef target f =         do ref <- fromSession target
src/Hint/Typecheck.hs view
@@ -65,11 +65,7 @@  -- add a bogus Maybe, in order to use it with mayFail exprType :: GHC.GhcMonad m => String -> m (Maybe GHC.Type)-#if __GLASGOW_HASKELL__ < 802-exprType = fmap Just . GHC.exprType-#else exprType = fmap Just . GHC.exprType GHC.TM_Inst-#endif  -- add a bogus Maybe, in order to use it with mayFail typeKind :: GHC.GhcMonad m => String -> m (Maybe (GHC.Type, GHC.Kind))
unit-tests/run-unit-tests.hs view
@@ -328,7 +328,7 @@     catchIE = MC.catch  succeeds :: (MonadCatch m, MonadIO m) => m a -> m Bool-succeeds = liftM not . fails+succeeds = fmap not . fails  data IOTestCase = IOTestCase String [FilePath] ((Interpreter () -> IO (Either InterpreterError ())) -> IO (Either InterpreterError ()))