summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkfine <>2018-10-11 04:51:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-10-11 04:51:00 (GMT)
commit89fcc430499ecec9bd852a0624972228039abc80 (patch)
tree0b88066df78a0bf389488423d85d39e8f9b977fc
parent1e96aa261880ab8f58e5cadaa38311dce7834a71 (diff)
version 0.0.65HEAD0.0.65master
-rw-r--r--preamble.cabal19
-rw-r--r--src/Preamble/Types/Alias.hs12
-rw-r--r--src/Preamble/Types/Ctx.hs5
-rw-r--r--src/Preamble/Types/Trans.hs7
4 files changed, 22 insertions, 21 deletions
diff --git a/preamble.cabal b/preamble.cabal
index 79bfcbc..6d40c2d 100644
--- a/preamble.cabal
+++ b/preamble.cabal
@@ -1,6 +1,6 @@
cabal-version: >=1.22
name: preamble
-version: 0.0.64
+version: 0.0.65
license: MIT
license-file: LICENSE
copyright: Copyright (C) 2016 Swift Navigation, Inc.
@@ -36,25 +36,24 @@ library
default-language: Haskell2010
ghc-options: -Wall
build-depends:
- MonadRandom >=0.5.1.1,
+ MonadRandom >=0.5.1,
aeson >=1.2.4.0,
base >=4.8 && <5,
basic-prelude >=0.7.0,
exceptions >=0.8.3,
fast-logger >=2.4.11,
- lens >=4.16.1,
+ lens >=4.15.4,
lifted-base >=0.2.3.12,
monad-control >=1.0.2.3,
- monad-logger >=0.3.28.5,
+ monad-logger >=0.3.28.2,
mtl >=2.2.2,
- network >=2.6.3.6,
- resourcet >=1.2.1,
- safe >=0.3.17,
+ network >=2.6.3.4,
+ resourcet >=1.1.11,
+ safe >=0.3.15,
template-haskell >=2.12.0.0,
- text >=1.2.3.0,
+ text >=1.2.2.2,
text-manipulate >=0.2.0.1,
time >=1.8.0.2,
transformers-base >=0.4.4,
- unliftio-core >=0.1.1.0,
- unordered-containers >=0.2.9.0,
+ unordered-containers >=0.2.8.0,
uuid >=1.3.13
diff --git a/src/Preamble/Types/Alias.hs b/src/Preamble/Types/Alias.hs
index 8bb21af..02a8cc2 100644
--- a/src/Preamble/Types/Alias.hs
+++ b/src/Preamble/Types/Alias.hs
@@ -8,7 +8,10 @@ module Preamble.Types.Alias
( module Preamble.Types.Alias
) where
+import Control.Monad.Catch
import Control.Monad.Logger
+import Control.Monad.Random
+import Control.Monad.Trans.Control
import Data.Aeson
import Preamble.Prelude
@@ -27,3 +30,12 @@ type Logger = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
-- | Stat
--
type Stat = ByteString -> IO ()
+
+-- | MonadControl
+--
+type MonadControl m =
+ ( MonadBaseControl IO m
+ , MonadIO m
+ , MonadMask m
+ , MonadRandom m
+ )
diff --git a/src/Preamble/Types/Ctx.hs b/src/Preamble/Types/Ctx.hs
index c4a6d57..e91c1b9 100644
--- a/src/Preamble/Types/Ctx.hs
+++ b/src/Preamble/Types/Ctx.hs
@@ -10,7 +10,6 @@ module Preamble.Types.Ctx
) where
import Control.Monad.Catch
-import Control.Monad.IO.Unlift
import Control.Monad.Logger
import Control.Monad.Reader
import Preamble.Lens
@@ -31,13 +30,11 @@ data Ctx = Ctx
$(makeClassy ''Ctx)
type MonadCtx c m =
- ( MonadIO m
+ ( MonadControl m
, MonadReader c m
, MonadLogger m
- , MonadMask m
, MonadCatch m
, MonadThrow m
- , MonadUnliftIO m
, HasCtx c
)
diff --git a/src/Preamble/Types/Trans.hs b/src/Preamble/Types/Trans.hs
index 3bbcc0d..896ec47 100644
--- a/src/Preamble/Types/Trans.hs
+++ b/src/Preamble/Types/Trans.hs
@@ -12,13 +12,11 @@ module Preamble.Types.Trans
, MonadBaseControl
, MonadReader
, MonadResource
- , MonadUnliftIO
, runResourceT
) where
import Control.Monad.Base
import Control.Monad.Catch
-import Control.Monad.IO.Unlift
import Control.Monad.Logger
import Control.Monad.Random
import Control.Monad.Reader
@@ -62,11 +60,6 @@ instance MonadResource m => MonadResource (TransT c m) where
liftResourceT = lift . liftResourceT
{-# INLINE liftResourceT #-}
-instance MonadUnliftIO m => MonadUnliftIO (TransT c m) where
- askUnliftIO = TransT $ (\(UnliftIO f) -> UnliftIO $ f . unTransT)
- <$> askUnliftIO
- {-# INLINE askUnliftIO #-}
-
instance MonadRandom m => MonadRandom (TransT c m) where
getRandom = lift getRandom
{-# INLINE getRandom #-}