box 0.0.1.2 → 0.0.1.4
raw patch · 8 files changed
+19/−61 lines, 8 filesdep −mmorphdep −stmdep ~dejafu
Dependencies removed: mmorph, stm
Dependency ranges changed: dejafu
Files
- box.cabal +3/−43
- readme.md +4/−4
- src/Box/Connectors.hs +0/−1
- src/Box/Control.hs +6/−7
- src/Box/Emitter.hs +1/−1
- src/Box/Queue.hs +2/−2
- stack.yaml +1/−1
- test/ctest.hs +2/−2
box.cabal view
@@ -1,5 +1,5 @@ name: box-version: 0.0.1.2+version: 0.0.1.4 synopsis: boxes description: concurrent, effectful boxes category: project@@ -49,18 +49,13 @@ , concurrency , contravariant , data-default- , dejafu < 2 , exceptions , flow , foldl- , generic-lens , lens- , mmorph , pipes , profunctors , protolude- , random- , stm , streaming , text , time@@ -76,30 +71,17 @@ test ghc-options: -funbox-strict-fields -fforce-recomp -threaded -rtsopts -with-rtsopts=-N build-depends:- async- , attoparsec- , base >=4.7 && <5+ base >=4.7 && <5 , box , concurrency- , contravariant- , data-default , dejafu- , exceptions- , flow- , foldl , generic-lens , lens- , mmorph- , pipes- , profunctors , protolude , random- , stm , streaming , text- , time , transformers- , transformers-base default-language: Haskell2010 test-suite test@@ -111,29 +93,7 @@ test ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- async- , attoparsec- , base >=4.7 && <5- , box- , concurrency- , contravariant- , data-default- , dejafu+ base >=4.7 && <5 , doctest- , exceptions- , flow- , foldl- , generic-lens- , lens- , mmorph- , pipes- , profunctors , protolude- , random- , stm- , streaming- , text- , time- , transformers- , transformers-base default-language: Haskell2010
readme.md view
@@ -1,12 +1,12 @@ [box](https://tonyday567.github.io/box/index.html) [](https://travis-ci.org/tonyday567/box) === -A concurrent, effectful, composable box to put stuff in and take stuff out.+A concurrent, potentially effectful, profunctoril, composable box to put stuff in and take stuff out. -compilation recipe----+It's a pretty solid box. -`box-test` takes about 5 minutes to run.+recipe+--- ``` stack build --test --exec "$(stack path --local-install-root)/bin/box-test" --file-watch
src/Box/Connectors.hs view
@@ -7,7 +7,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wall #-}-{-# OPTIONS_GHC -fno-warn-type-defaults #-} -- | various ways to connect things up module Box.Connectors
src/Box/Control.hs view
@@ -13,6 +13,7 @@ ( ControlComm(..) , ControlBox , ControlConfig(..)+ , defaultControlConfig , consoleControlBox , parseControlComms , controlBox@@ -28,8 +29,6 @@ import Control.Lens hiding ((|>)) import Control.Monad import Data.Data-import Data.Default--- import Data.IORef import Flow import GHC.Generics import Protolude hiding ((.), STM)@@ -59,8 +58,8 @@ | AllowDeath deriving (Show, Eq) -instance Default ControlConfig where- def = AllowDeath+defaultControlConfig :: ControlConfig+defaultControlConfig = AllowDeath consoleControlBox :: ControlBox IO consoleControlBox =@@ -73,8 +72,8 @@ parseControlComms :: A.Parser ControlComm parseControlComms =- A.string "q" *> return Stop <|> A.string "s" *> return Start <|>- A.string "x" *> return Kill <|> do+ A.string "q" $> Stop <|> A.string "s" $> Start <|>+ A.string "x" $> Kill <|> do res <- readMaybe . Text.unpack <$> A.takeText case res of Nothing -> mzero@@ -116,7 +115,7 @@ go ref Reset -> do a <- C.readIORef ref- when (not $ isNothing a) (cancel' ref)+ unless (isNothing a) (cancel' ref) _ <- start ref c go ref _ -> go ref
src/Box/Emitter.hs view
@@ -111,7 +111,7 @@ -- | attoparsec parse emitter eParse :: (Functor m) => A.Parser a -> Emitter m Text -> Emitter m (Either Text a)-eParse parser e = (either (Left . Text.pack) Right . A.parseOnly parser) <$> e+eParse parser e = either (Left . Text.pack) Right . A.parseOnly parser <$> e -- | read parse emitter eRead ::
src/Box/Queue.hs view
@@ -180,7 +180,7 @@ withQM q spawner cio eio = C.bracket (spawner q)- (\(_, seal) -> seal)+ snd (\(box, seal) -> concurrently (cio (committer box) `C.finally` seal)@@ -196,7 +196,7 @@ withQMLog q spawner cio eio = C.bracket (spawner q)- (\(_, seal) -> seal)+ snd (\(box, seal) -> concurrently (cio (committer box) `C.finally` (putStrLn ("committer sealed" :: Text) >> seal))
stack.yaml view
@@ -1,4 +1,4 @@-resolver: lts-13.21+resolver: lts-14.11 packages: - .
test/ctest.hs view
@@ -34,7 +34,7 @@ import Data.String import Protolude hiding (STM) import Test.DejaFu-import Test.DejaFu.Conc+import Test.DejaFu.Types import qualified Streaming.Prelude as S import System.Random import Control.Lens hiding ((:>), (.>), (<|), (|>))@@ -94,7 +94,7 @@ exe1c2IO n = e1c2IO (toEmit (S.take n $ S.each [0..])) -- | test when the deterministic takes too long (which is almost always)-t :: (MonadConc n, MonadIO n, Eq b, Show b) =>+t :: (MonadConc n, MonadIO n, Eq b, Show b, MonadDejaFu n) => String -> ConcT n b -> n Bool t l c = dejafuWay (randomly (mkStdGen 42) 1000) defaultMemType l alwaysSame c