drama 0.4.0.0 → 0.5.0.0
raw patch · 6 files changed
+35/−31 lines, 6 filesdep +ki-unlifteddep +stmdep +unliftio-coredep −kidep ~transformersPVP ok
version bump matches the API change (PVP)
Dependencies added: ki-unlifted, stm, unliftio-core
Dependencies removed: ki
Dependency ranges changed: transformers
API changes (from Hackage documentation)
+ Drama.Internal: instance Control.Monad.IO.Unlift.MonadUnliftIO (Drama.Internal.Actor msg)
Files
- CHANGELOG.md +11/−2
- LICENSE +1/−1
- drama.cabal +14/−19
- examples/use.hs +0/−3
- src/Drama.hs +1/−1
- src/Drama/Internal.hs +8/−5
CHANGELOG.md view
@@ -5,8 +5,15 @@ The format is based on [Keep a Changelog][changelog], and this project adheres to the [Haskell Package Versioning Policy][pvp]. -## [0.4.0.0] - Unreleased+## [0.6.0.0] - Unreleased +## [0.5.0.0] - 2022-07-16++- Update to `ki-unlifted` 1.0.0+- Add `MonadUnliftIO` instance for `Actor` monad++## [0.4.0.0] - 2021-05-19+ - Remove low-level `Process` API in favor of high-level `Server` API - Rename "process" to "actor" everywhere - Consolidate everything under `Drama` and `Drama.Internal` modules@@ -102,7 +109,9 @@ Initial release -[0.4.0.0]: https://github.com/evanrelf/drama/compare/v0.3.0.0...HEAD+[0.6.0.0]: https://github.com/evanrelf/drama/compare/v0.5.0.0...HEAD+[0.5.0.0]: https://github.com/evanrelf/drama/releases/tag/v0.5.0.0+[0.4.0.0]: https://github.com/evanrelf/drama/releases/tag/v0.4.0.0 [0.3.0.0]: https://github.com/evanrelf/drama/releases/tag/v0.3.0.0 [0.2.0.0]: https://github.com/evanrelf/drama/releases/tag/v0.2.0.0 [0.1.0.3]: https://github.com/evanrelf/drama/releases/tag/v0.1.0.3
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2021, Evan Relf+Copyright (c) 2022, Evan Relf All rights reserved. Redistribution and use in source and binary forms, with or without
drama.cabal view
@@ -1,7 +1,7 @@-cabal-version: 2.4+cabal-version: 2.2 name: drama-version: 0.4.0.0+version: 0.5.0.0 synopsis: Actor library for Haskell description: Actor library for Haskell category: Concurrency@@ -9,8 +9,8 @@ maintainer: Evan Relf <evan@evanrelf.com> homepage: https://github.com/evanrelf/drama license: BSD-3-Clause-copyright: 2021 Evan Relf-tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.3+copyright: 2022 Evan Relf+tested-with: GHC == 8.6, GHC == 8.8, GHC == 8.10, GHC == 9.0 license-file: LICENSE extra-source-files:@@ -44,30 +44,25 @@ -with-rtsopts=-N -common hie- if impl(ghc >= 8.8)- ghc-options:- -fwrite-ide-info- -hiedir=.hie-- library- import: common, hie+ import: common hs-source-dirs: src build-depends:- ki >= 0.2 && < 0.3- , transformers >= 0.5 && < 1.0- , unagi-chan >= 0.4 && < 0.5+ , ki-unlifted >= 1.0 && < 2.0+ , stm+ , transformers+ , unagi-chan >= 0.4 && < 0.5+ , unliftio-core exposed-modules:- Drama- , Drama.Internal+ Drama+ Drama.Internal executable example-shared-resource- import: common, executable, hie+ import: common, executable main-is: examples/shared-resource.hs executable example-use- import: common, executable, hie+ import: common, executable main-is: examples/use.hs
examples/use.hs view
@@ -119,6 +119,3 @@ , put = \s -> cast stateAddr (PutState s) , modify = \f -> cast stateAddr (ModifyState f) }---{- HLINT ignore "Avoid lambda" -}
src/Drama.hs view
@@ -2,7 +2,7 @@ -- Module: Drama -- Stability: experimental -- License: BSD-3-Clause--- Copyright: © 2021 Evan Relf+-- Copyright: © 2022 Evan Relf -- Maintainer: evan@evanrelf.com -- -- Actor library for Haskell
src/Drama/Internal.hs view
@@ -14,21 +14,23 @@ -- Module: Drama.Internal -- Stability: experimental -- License: BSD-3-Clause--- Copyright: © 2021 Evan Relf+-- Copyright: © 2022 Evan Relf -- Maintainer: evan@evanrelf.com module Drama.Internal where import Control.Applicative (Alternative) import Control.Concurrent (MVar, newEmptyMVar, putMVar, takeMVar)-import Control.Monad (MonadPlus)+import Control.Monad (MonadPlus, void) import Control.Monad.Fix (MonadFix) import Control.Monad.IO.Class (MonadIO (..))+import Control.Monad.IO.Unlift (MonadUnliftIO) import Control.Monad.Trans.Reader (ReaderT (..), asks) import Data.Kind (Type) import qualified Control.Concurrent.Chan.Unagi as Unagi-import qualified Ki+import qualified Control.Concurrent.STM as STM+import qualified Ki.Unlifted as Ki -- Support `MonadFail` on GHC 8.6.5 #if MIN_VERSION_base(4,9,0)@@ -48,6 +50,7 @@ , Applicative , Monad , MonadIO+ , MonadUnliftIO -- ^ @since 0.5.0.0 , Alternative , MonadPlus #if MIN_VERSION_base(4,9,0)@@ -144,7 +147,7 @@ -> Actor _msg () spawnImpl address mailbox actor = do scope <- Actor $ asks scope- liftIO $ Ki.fork_ scope $ runActorImpl address mailbox actor+ void $ liftIO $ Ki.fork scope $ runActorImpl address mailbox actor -- | Block until all child actors have terminated.@@ -153,7 +156,7 @@ wait :: Actor msg () wait = do scope <- Actor $ asks scope- liftIO $ Ki.wait scope+ liftIO $ STM.atomically $ Ki.awaitAll scope -- | Return the current actor's address.