summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkfine <>2016-12-24 18:22:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-12-24 18:22:00 (GMT)
commit23c8e601682672a888410d2262045fc65c8aa1b8 (patch)
tree7b2fb95da024a29a0518cbe9e4c5d4eccdc177a1
parent44ab51dacd24b0cec41c26e7d5accbe99f2b7afc (diff)
version 0.3.40.3.4
-rwxr-xr-xShakefile.hs3
-rw-r--r--main/actor.hs2
-rw-r--r--main/decider.hs2
-rw-r--r--src/Network/AWS/Wolf/Act.hs11
-rw-r--r--src/Network/AWS/Wolf/Decide.hs15
-rw-r--r--src/Network/AWS/Wolf/File.hs6
-rw-r--r--src/Network/AWS/Wolf/Prelude.hs19
-rw-r--r--wolf.cabal2
8 files changed, 22 insertions, 38 deletions
diff --git a/Shakefile.hs b/Shakefile.hs
index 7d7a1e9..740714a 100755
--- a/Shakefile.hs
+++ b/Shakefile.hs
@@ -20,7 +20,6 @@ main = shakeMain $ do
, "Shakefile.hs"
, "main//*.hs"
, "src//*.hs"
- , "test//*.hs"
]
-- | Cabal rules.
@@ -34,7 +33,7 @@ main = shakeMain $ do
-- | sanity
--
fake' pats "sanity" $ const $
- need [ "lint", fakeFile "build-error" ]
+ need [ fakeFile "build-error", "lint" ]
-- | Default things to run.
--
diff --git a/main/actor.hs b/main/actor.hs
index 738e10e..1081693 100644
--- a/main/actor.hs
+++ b/main/actor.hs
@@ -27,7 +27,7 @@ instance ParseRecord Args
main :: IO ()
main = do
args <- getRecord "Actor"
- runResourceT $ actMain
+ actMain
(config args)
(queue args)
(command args)
diff --git a/main/decider.hs b/main/decider.hs
index 33979c9..9e832fa 100644
--- a/main/decider.hs
+++ b/main/decider.hs
@@ -25,6 +25,6 @@ instance ParseRecord Args
main :: IO ()
main = do
args <- getRecord "Decider"
- runResourceT $ decideMain
+ decideMain
(config args)
(plan args)
diff --git a/src/Network/AWS/Wolf/Act.hs b/src/Network/AWS/Wolf/Act.hs
index 261b14e..49ae35e 100644
--- a/src/Network/AWS/Wolf/Act.hs
+++ b/src/Network/AWS/Wolf/Act.hs
@@ -84,9 +84,10 @@ act queue command =
-- | Run actor from main with config file.
--
-actMain :: MonadMain m => FilePath -> Text -> String -> m ()
+actMain :: MonadControl m => FilePath -> Text -> String -> m ()
actMain cf queue command =
- runCtx $ do
- conf <- readYaml cf
- runConfCtx conf $
- forever $ act queue command
+ runResourceT $
+ runCtx $ do
+ conf <- readYaml cf
+ runConfCtx conf $
+ forever $ act queue command
diff --git a/src/Network/AWS/Wolf/Decide.hs b/src/Network/AWS/Wolf/Decide.hs
index fa735e6..07099e3 100644
--- a/src/Network/AWS/Wolf/Decide.hs
+++ b/src/Network/AWS/Wolf/Decide.hs
@@ -101,11 +101,12 @@ decide p =
-- | Run decider from main with config file.
--
-decideMain :: MonadMain m => FilePath -> FilePath -> m ()
+decideMain :: MonadControl m => FilePath -> FilePath -> m ()
decideMain cf pf =
- runCtx $ do
- conf <- readYaml cf
- runConfCtx conf $ do
- plans <- readYaml pf
- runConcurrent $
- (forever . decide) <$> plans
+ runResourceT $
+ runCtx $ do
+ conf <- readYaml cf
+ runConfCtx conf $ do
+ plans <- readYaml pf
+ runConcurrent $
+ (forever . decide) <$> plans
diff --git a/src/Network/AWS/Wolf/File.hs b/src/Network/AWS/Wolf/File.hs
index 28c8c89..e031c60 100644
--- a/src/Network/AWS/Wolf/File.hs
+++ b/src/Network/AWS/Wolf/File.hs
@@ -120,13 +120,13 @@ copyDirectoryRecursive fd td =
-- | Setup a temporary work directory.
--
-withWorkDirectory :: MonadBaseControlIO m => Text -> (FilePath -> m a) -> m a
+withWorkDirectory :: MonadControl m => Text -> (FilePath -> m a) -> m a
withWorkDirectory uid =
bracket (getWorkDirectory uid) (liftIO . removeDirectoryRecursive)
-- | Change to directory and then return to current directory.
--
-withCurrentDirectory :: MonadBaseControlIO m => FilePath -> (FilePath -> m a) -> m a
+withCurrentDirectory :: MonadControl m => FilePath -> (FilePath -> m a) -> m a
withCurrentDirectory wd action =
bracket (liftIO getCurrentDirectory) (liftIO . setCurrentDirectory) $ \cd -> do
liftIO $ setCurrentDirectory wd
@@ -134,7 +134,7 @@ withCurrentDirectory wd action =
-- | Setup a temporary work directory and copy current directory files to it.
--
-withCurrentWorkDirectory :: MonadBaseControlIO m => Text -> (FilePath -> m a) -> m a
+withCurrentWorkDirectory :: MonadControl m => Text -> (FilePath -> m a) -> m a
withCurrentWorkDirectory uid action =
withWorkDirectory uid $ \wd ->
withCurrentDirectory wd $ \cd -> do
diff --git a/src/Network/AWS/Wolf/Prelude.hs b/src/Network/AWS/Wolf/Prelude.hs
index cad8bd2..0bbbfa0 100644
--- a/src/Network/AWS/Wolf/Prelude.hs
+++ b/src/Network/AWS/Wolf/Prelude.hs
@@ -6,17 +6,12 @@
--
module Network.AWS.Wolf.Prelude
( module Exports
- , runResourceT
, runConcurrent
, stripPrefix'
- , MonadBaseControlIO
- , MonadMain
) where
import Control.Concurrent.Async.Lifted
-import Control.Monad.Catch
import Control.Monad.Trans.Control
-import Control.Monad.Trans.Resource
import Data.Text hiding (map)
import Preamble as Exports hiding (stripPrefix)
@@ -28,16 +23,4 @@ runConcurrent = void . runConcurrently . sequenceA . map Concurrently
-- | Strip the prefix with a '/' tacked on to the prefix.
--
stripPrefix' :: Text -> Text -> Maybe Text
-stripPrefix' prefix =
- stripPrefix (prefix -/- mempty)
-
-type MonadBaseControlIO m =
- ( MonadBaseControl IO m
- , MonadIO m
- )
-
-type MonadMain m =
- ( MonadBaseControlIO m
- , MonadResource m
- , MonadCatch m
- )
+stripPrefix' prefix = stripPrefix (prefix -/- mempty)
diff --git a/wolf.cabal b/wolf.cabal
index 962a431..8faa6bb 100644
--- a/wolf.cabal
+++ b/wolf.cabal
@@ -1,5 +1,5 @@
name: wolf
-version: 0.3.3
+version: 0.3.4
synopsis: Amazon Simple Workflow Service Wrapper.
description: Wolf is a wrapper around Amazon Simple Workflow Service.
homepage: https://github.com/swift-nav/wolf