Skip to content

Commit da81e9a

Browse files
committed
removes mtl
1 parent 9591b1d commit da81e9a

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

bitcoin.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ library
107107
, hashable >=1.3.0.0
108108
, hspec >=2.7.1
109109
, memory >=0.15.0
110-
, mtl >=2.2.2
111110
, murmur3 >=1.0.3
112111
, network >=3.1.1.1
113112
, safe >=0.3.18
@@ -164,7 +163,6 @@ test-suite spec
164163
, lens >=4.18.1
165164
, lens-aeson >=1.1
166165
, memory >=0.15.0
167-
, mtl >=2.2.2
168166
, murmur3 >=1.0.3
169167
, network >=3.1.1.1
170168
, safe >=0.3.18

package.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies:
3333
- hashable >= 1.3.0.0
3434
- hspec >= 2.7.1
3535
- memory >= 0.15.0
36-
- mtl >= 2.2.2
3736
- murmur3 >= 1.0.3
3837
- network >= 3.1.1.1
3938
- QuickCheck >= 2.13.2

src/Haskoin/Block/Headers.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ module Haskoin.Block.Headers (
7272
import Control.Applicative ((<|>))
7373
import Control.DeepSeq
7474
import Control.Monad (guard, mzero, unless, when)
75-
import Control.Monad.Except (
75+
import Control.Monad.Trans.Class (lift)
76+
import Control.Monad.Trans.Except (
7677
ExceptT (..),
7778
runExceptT,
78-
throwError,
79+
throwE,
7980
)
80-
import Control.Monad.State.Strict as State (
81+
import Control.Monad.Trans.Maybe
82+
import Control.Monad.Trans.State.Strict as State (
8183
StateT,
8284
get,
8385
gets,
84-
lift,
8586
modify,
8687
)
87-
import Control.Monad.Trans.Maybe
8888
import Data.Binary (Binary (..))
8989
import Data.Bits (shiftL, shiftR, (.&.))
9090
import qualified Data.ByteString as B
@@ -332,7 +332,7 @@ connectBlocks _ _ [] = return $ Right []
332332
connectBlocks net t bhs@(bh : _) =
333333
runExceptT $ do
334334
unless (chained bhs) $
335-
throwError "Blocks to connect do not form a chain"
335+
throwE "Blocks to connect do not form a chain"
336336
par <-
337337
maybeToExceptT
338338
"Could not get parent block"
@@ -356,13 +356,13 @@ connectBlocks net t bhs@(bh : _) =
356356
case skM of
357357
Just sk -> return sk
358358
Nothing ->
359-
throwError $
359+
throwE $
360360
"BUG: Could not get skip for block "
361361
++ show (headerHash $ nodeHeader par)
362362
| otherwise = do
363363
let sn = ls !! fromIntegral (nodeHeight par - sh)
364364
when (nodeHeight sn /= sh) $
365-
throwError "BUG: Node height not right in skip"
365+
throwE "BUG: Node height not right in skip"
366366
return sn
367367
where
368368
sh = skipHeight (nodeHeight par + 1)
@@ -403,7 +403,7 @@ connectBlock net t bh =
403403
case skM of
404404
Just sk -> return sk
405405
Nothing ->
406-
throwError $
406+
throwE $
407407
"BUG: Could not get skip for block "
408408
++ show (headerHash $ nodeHeader par)
409409
bb <- lift getBestBlockHeader

src/Haskoin/Transaction/Builder.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module Haskoin.Transaction.Builder (
3434
import Control.Applicative ((<|>))
3535
import Control.Arrow (first)
3636
import Control.Monad (foldM, unless)
37-
import Control.Monad.Identity (runIdentity)
37+
import Control.Monad.Trans.Identity (runIdentityT)
3838
import Crypto.Secp256k1
3939
import qualified Data.ByteString as B
4040
import Data.Bytes.Get

src/Haskoin/Util.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module Haskoin.Util (
2525
-- * Maybe & Either Helpers
2626
eitherToMaybe,
2727
maybeToEither,
28-
liftEither,
2928
liftMaybe,
3029

3130
-- * Other Helpers
@@ -58,7 +57,7 @@ module Haskoin.Util (
5857
) where
5958

6059
import Control.Monad
61-
import Control.Monad.Except (ExceptT (..), liftEither)
60+
import Control.Monad.Trans.Except (ExceptT (..))
6261
import Data.Bits
6362
import Data.ByteString (ByteString)
6463
import qualified Data.ByteString as BS
@@ -154,7 +153,7 @@ maybeToEither err = maybe (Left err) Right
154153

155154
-- | Lift a 'Maybe' computation into the 'ExceptT' monad.
156155
liftMaybe :: Monad m => b -> Maybe a -> ExceptT b m a
157-
liftMaybe err = liftEither . maybeToEither err
156+
liftMaybe err = ExceptT . pure . maybeToEither err
158157

159158

160159
-- Various helpers

0 commit comments

Comments
 (0)