diff options
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent/Exchange.hs | 5 | ||||
-rw-r--r-- | src/Network/BitTorrent/Internal.hs | 9 |
2 files changed, 1 insertions, 13 deletions
diff --git a/src/Network/BitTorrent/Exchange.hs b/src/Network/BitTorrent/Exchange.hs index 0fd1d15a..75bd4bfd 100644 --- a/src/Network/BitTorrent/Exchange.hs +++ b/src/Network/BitTorrent/Exchange.hs | |||
@@ -6,11 +6,9 @@ | |||
6 | -- Portability : portable | 6 | -- Portability : portable |
7 | -- | 7 | -- |
8 | {-# LANGUAGE OverloadedStrings #-} | 8 | {-# LANGUAGE OverloadedStrings #-} |
9 | {-# LANGUAGE DoAndIfThenElse #-} | ||
10 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 9 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
11 | {-# LANGUAGE MultiParamTypeClasses #-} | 10 | {-# LANGUAGE MultiParamTypeClasses #-} |
12 | {-# LANGUAGE RecordWildCards #-} | 11 | {-# LANGUAGE RecordWildCards #-} |
13 | {-# LANGUAGE FlexibleContexts #-} | ||
14 | {-# LANGUAGE BangPatterns #-} | 12 | {-# LANGUAGE BangPatterns #-} |
15 | module Network.BitTorrent.Exchange | 13 | module Network.BitTorrent.Exchange |
16 | ( -- * Block | 14 | ( -- * Block |
@@ -34,7 +32,6 @@ import Control.Applicative | |||
34 | import Control.Exception | 32 | import Control.Exception |
35 | import Control.Concurrent | 33 | import Control.Concurrent |
36 | import Control.Lens | 34 | import Control.Lens |
37 | import Control.Monad.Fork.Class | ||
38 | import Control.Monad.Reader | 35 | import Control.Monad.Reader |
39 | import Control.Monad.State | 36 | import Control.Monad.State |
40 | import Control.Monad.Trans.Resource | 37 | import Control.Monad.Trans.Resource |
@@ -111,8 +108,6 @@ instance MonadState SessionState P2P where | |||
111 | put !s = asks sessionState >>= \ref -> liftIO $ writeIORef ref s | 108 | put !s = asks sessionState >>= \ref -> liftIO $ writeIORef ref s |
112 | {-# INLINE put #-} | 109 | {-# INLINE put #-} |
113 | 110 | ||
114 | -- TODO instance for MonadFork | ||
115 | |||
116 | runSession :: SwarmSession -> PeerAddr -> P2P () -> IO () | 111 | runSession :: SwarmSession -> PeerAddr -> P2P () -> IO () |
117 | runSession se addr p2p = | 112 | runSession se addr p2p = |
118 | handle isIOException $ | 113 | handle isIOException $ |
diff --git a/src/Network/BitTorrent/Internal.hs b/src/Network/BitTorrent/Internal.hs index 5ac58d46..f163cadb 100644 --- a/src/Network/BitTorrent/Internal.hs +++ b/src/Network/BitTorrent/Internal.hs | |||
@@ -14,15 +14,9 @@ | |||
14 | -- data should be modified through standalone functions. | 14 | -- data should be modified through standalone functions. |
15 | -- | 15 | -- |
16 | {-# LANGUAGE OverloadedStrings #-} | 16 | {-# LANGUAGE OverloadedStrings #-} |
17 | {-# LANGUAGE BangPatterns #-} | ||
18 | {-# LANGUAGE RecordWildCards #-} | 17 | {-# LANGUAGE RecordWildCards #-} |
19 | {-# LANGUAGE TemplateHaskell #-} | 18 | {-# LANGUAGE TemplateHaskell #-} |
20 | {-# LANGUAGE DeriveDataTypeable #-} | 19 | {-# LANGUAGE DeriveDataTypeable #-} |
21 | {-# LANGUAGE FlexibleInstances #-} | ||
22 | {-# LANGUAGE FlexibleContexts #-} | ||
23 | {-# LANGUAGE MultiParamTypeClasses #-} | ||
24 | {-# LANGUAGE UndecidableInstances #-} | ||
25 | {-# LANGUAGE ConstraintKinds #-} | ||
26 | module Network.BitTorrent.Internal | 20 | module Network.BitTorrent.Internal |
27 | ( Progress(..), startProgress | 21 | ( Progress(..), startProgress |
28 | 22 | ||
@@ -79,9 +73,8 @@ import Control.Concurrent | |||
79 | import Control.Concurrent.STM | 73 | import Control.Concurrent.STM |
80 | import Control.Concurrent.MSem as MSem | 74 | import Control.Concurrent.MSem as MSem |
81 | import Control.Lens | 75 | import Control.Lens |
82 | import Control.Monad.State | ||
83 | import Control.Monad.Reader | ||
84 | import Control.Exception | 76 | import Control.Exception |
77 | import Control.Monad.Trans | ||
85 | 78 | ||
86 | import Data.IORef | 79 | import Data.IORef |
87 | import Data.Default | 80 | import Data.Default |