hint-server 1.2.2 → 1.4.3
raw patch · 3 files changed
Files
- changelog +9/−0
- hint-server.cabal +9/−12
- src/Language/Haskell/Interpreter/Server.hs +12/−4
+ changelog view
@@ -0,0 +1,9 @@+Version 1.4:+- bump version of exception +- bump version of eprocess++Version 1.3:+- bump version of Hint+- bump version of eprocess+- Corentin Dupont takes over maintainance (as agreed with Fernando Benavides)+- compiling with GHC 7.8
hint-server.cabal view
@@ -1,5 +1,5 @@ name: hint-server-version: 1.2.2+version: 1.4.3 cabal-version: >=1.6 build-type: Simple license: BSD3@@ -7,28 +7,25 @@ copyright: 2009 Fernando "Brujo" Benavides maintainer: corentin.dupont@gmail.com stability: stable-package-url: http://code.haskell.org/hint-server-bug-reports: http://github.com/elbrujohalcon/hint-server/issues synopsis: A server process that runs hint. description: This library provides a server process (implemented using eprocess) that can receive and run actions in the Interpreter monad. category: Concurrency, Language, Compilers/Interpreters author: Fernando "Brujo" Benavides-tested-with: GHC ==6.12.1 data-files: LICENSE README data-dir: ""-extra-source-files: Setup.hs+extra-source-files: Setup.hs, changelog extra-tmp-files: source-repository head type: git- location: git://github.com/elbrujohalcon/hint-server.git+ location: https://github.com/cdupont/hint-server.git Library- build-depends: base >= 4, base < 5,- mtl >=1.1.0, mtl < 2.2,- monad-loops >=0.3.0, monad-loops < 0.4,- hint >=0.3.1, hint < 0.4,- eprocess >=1.1.2, eprocess < 2+ build-depends: base == 4.*,+ mtl >= 2.1 && < 2.3,+ monad-loops >= 0.3 && < 0.5,+ hint >= 0.6.0,+ eprocess == 1.7.*,+ exceptions >= 0.6 && < 0.9 exposed-modules: Language.Haskell.Interpreter.Server hs-source-dirs: src-
src/Language/Haskell/Interpreter/Server.hs view
@@ -1,3 +1,6 @@+{-# LANGUAGE ImpredicativeTypes #-}+{-# LANGUAGE CPP #-}+ -- | This module provides a server process (implemented using eprocess) that can receive and run actions in the Interpreter monad. module Language.Haskell.Interpreter.Server ( -- * Types@@ -7,8 +10,13 @@ ) where import Control.Concurrent.MVar+#if __GLASGOW_HASKELL__ >= 800+import Control.Monad.Except+#else import Control.Monad.Error+#endif import Control.Monad.Loops+import Control.Monad.Catch (catch) import Control.Concurrent.Process import Language.Haskell.Interpreter @@ -18,15 +26,15 @@ instance MonadInterpreter m => MonadInterpreter (ReceiverT r m) where fromSession = lift . fromSession- modifySessionRef a = lift . (modifySessionRef a)- runGhc = lift . runGhc + modifySessionRef a = lift . modifySessionRef a+ runGhc = lift . runGhc -- | Starts the server. Usage: -- @ -- handle <- start -- @ start :: IO ServerHandle-start = (spawn $ makeProcess runInterpreter interpreter) >>= return . SH+start = fmap SH (spawn $ makeProcess runInterpreter interpreter) where interpreter = do setImports ["Prelude"]@@ -66,7 +74,7 @@ flush server = runIn server $ return () try :: InterpreterT IO b -> InterpreterT IO (Either InterpreterError b)-try a = (a >>= return . Right) `catchError` (return . Left)+try a = fmap Right a `catch` (return . Left) -- | Stops the server. Usage: -- @