packages feed

eprocess 1.7.0 → 1.7.1

raw patch · 3 files changed

+24/−22 lines, 3 filesdep ~exceptionsdep ~mtlPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: exceptions, mtl

API changes (from Hackage documentation)

+ Control.Concurrent.Process: instance Applicative m => Applicative (ReceiverT r m)
+ Control.Concurrent.Process: instance Functor m => Functor (ReceiverT r m)

Files

README view
@@ -1,2 +1,2 @@-This library provides a *very* basic support for processes with message queues.  It was built using channels and MVars.+This library provides a basic support for processes with message queues.  It was built using channels and MVars. See http://hackage.haskell.org/package/eprocess
eprocess.cabal view
@@ -1,5 +1,5 @@ name: eprocess-version: 1.7.0+version: 1.7.1 cabal-version: >=1.6 build-type: Simple license: BSD3@@ -7,8 +7,8 @@ copyright: 2009 Fernando "Brujo" Benavides maintainer: corentin.dupont@gmail.com stability: stable-synopsis: *Very* basic Erlang-like process support for Haskell-description: This library provides a *very* basic support for processes with message queues.  It was built using channels, threads and MVars. Since version 1.1.0 you can also kill a running process.+synopsis: Basic Erlang-like process support for Haskell+description: This library provides a basic support for processes with message queues.  It was built using channels, threads and MVars. Since version 1.1.0 you can also kill a running process. category: Concurrency author: Fernando "Brujo" Benavides tested-with: GHC ==6.12.1@@ -23,8 +23,8 @@  Library     build-depends: base == 4.*,-                   mtl == 2.1.*,-                   exceptions == 0.6.*+                   mtl == 2.2.*,+                   exceptions == 0.8.*     exposed-modules: Control.Concurrent.Process     hs-source-dirs: src     
src/Control/Concurrent/Process.hs view
@@ -1,13 +1,14 @@-{-# LANGUAGE GeneralizedNewtypeDeriving,-             MultiParamTypeClasses,-             FlexibleInstances,-             FunctionalDependencies,-             UndecidableInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE StandaloneDeriving #-}  -- | This module provides a *very* basic support for processes with message queues.  It was built using channels and MVars. module Control.Concurrent.Process ( -- * Types-        ReceiverT, Handle, Process, +        ReceiverT, Handle, Process, -- * Functions -- ** Process creation / destruction         makeProcess, runHere, spawn, kill,@@ -22,6 +23,7 @@ import Control.Monad.Catch import Data.Monoid import Control.Concurrent+import Control.Applicative  -- | A Process handle.  It's returned on process creation and should be used -- | afterwards to send messages to it@@ -29,14 +31,14 @@                     thread   :: ThreadId}  -- | The /ReceiverT/ generic type.--- +-- -- [@r@] the type of things the process will receive--- +-- -- [@m@] the monad in which it will run--- +-- -- [@a@] the classic monad parameter newtype ReceiverT r m a = RT { internalReader :: ReaderT (Handle r) m a }-    deriving (Monad, MonadIO, MonadTrans, MonadCatch, MonadThrow, MonadMask)+   deriving (Functor, Applicative, Monad, MonadIO, MonadTrans, MonadCatch, MonadThrow, MonadMask)  -- | /Process/ are receivers that run in the IO Monad type Process r = ReceiverT r IO@@ -45,7 +47,7 @@ -- @ --      sendTo processHandle message -- @-sendTo :: MonadIO m => Handle a -- ^ The receiver process handle +sendTo :: MonadIO m => Handle a -- ^ The receiver process handle         -> a                    -- ^ The message to send         -> m () sendTo ph = liftIO . writeChan (chan ph)@@ -91,11 +93,11 @@ -- | /sendRecv/ is just a syntactic sugar for: -- @ --      sendTo h a >> recv--- @ +-- @ sendRecv :: MonadIO m => Handle a -- ^ The receiver process handle           -> a                    -- ^ The message to send           -> ReceiverT r m r      -- ^ The process where this action is run will wait until it receives something-sendRecv h a = sendTo h a >> recv +sendRecv h a = sendTo h a >> recv  -- | /spawn/ starts a process and returns its handle. Usage: -- @@@ -132,8 +134,8 @@ -- | /makeProcess/ builds a process from a code that generates an IO action. Usage: -- @ --      process <- makeProcess evalFunction receiver--- @ -makeProcess :: (m t -> IO s) -> ReceiverT r m t -> Process r s +-- @+makeProcess :: (m t -> IO s) -> ReceiverT r m t -> Process r s makeProcess f (RT a) = RT (mapReaderT f a)  instance MonadState s m => MonadState s (ReceiverT r m) where@@ -142,7 +144,7 @@  instance MonadReader r m => MonadReader r (ReceiverT r m) where     ask = lift ask-    local = onInner . local +    local = onInner . local  instance (Monoid w, MonadWriter w m) => MonadWriter w (ReceiverT w m) where     tell = lift . tell