Skip to content

Commit e5a0bf0

Browse files
committed
bfx dead code elimination
1 parent c9bad63 commit e5a0bf0

33 files changed

+161
-195
lines changed

pub/bfx/bfx.cabal

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,14 @@ common pkg-lib
9292
, functora
9393
, functora:cfg
9494
, functora:money
95-
, functora:sql
9695
, http-client
9796
, http-client-tls
9897
, http-types
99-
, katip
10098
, lens-aeson
10199
, memory
102100
, siggy-chardust
103-
, temporary
101+
, singlethongs
104102
, text
105-
, transformers
106-
, unliftio
107103
, vector
108104

109105
library
@@ -131,16 +127,12 @@ library
131127
Bfx.Data.Type
132128
Bfx.Data.Wallets
133129
Bfx.Data.Web
134-
Bfx.Import
135-
Bfx.Import.External
136-
Bfx.Import.Internal
137130
Bfx.Indicator.Atr
138131
Bfx.Indicator.Ma
139132
Bfx.Indicator.Tr
140133
Bfx.Math
141134
Bfx.Parser
142135
Bfx.Rpc.Generic
143-
Bfx.Util
144136

145137
test-suite bfx-test
146138
import: pkg
@@ -161,6 +153,8 @@ test-suite bfx-test
161153
, base
162154
, bfx
163155
, containers
156+
, functora
157+
, functora:money
164158
, hspec
165159

166160
if flag(ghcid)
@@ -182,16 +176,12 @@ test-suite bfx-test
182176
Bfx.Data.Type
183177
Bfx.Data.Wallets
184178
Bfx.Data.Web
185-
Bfx.Import
186-
Bfx.Import.External
187-
Bfx.Import.Internal
188179
Bfx.Indicator.Atr
189180
Bfx.Indicator.Ma
190181
Bfx.Indicator.Tr
191182
Bfx.Math
192183
Bfx.Parser
193184
Bfx.Rpc.Generic
194-
Bfx.Util
195185

196186
hs-source-dirs: src
197187
ghc-options: -Wno-unused-packages
@@ -203,21 +193,15 @@ test-suite bfx-test
203193
, containers
204194
, cryptonite
205195
, envparse
206-
, functora
207196
, functora:cfg
208-
, functora:money
209-
, functora:sql
210197
, http-client
211198
, http-client-tls
212199
, http-types
213-
, katip
214200
, lens-aeson
215201
, memory
216202
, siggy-chardust
217-
, temporary
203+
, singlethongs
218204
, text
219-
, transformers
220-
, unliftio
221205
, vector
222206

223207
else

pub/bfx/src/Bfx.hs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,33 @@ module Bfx
3030
)
3131
where
3232

33+
import Bfx.Class.FromRpc as X
34+
import Bfx.Class.ToBaseUrl as X
35+
import Bfx.Class.ToPathPieces as X
36+
import Bfx.Class.ToRequestMethod as X
37+
import Bfx.Class.ToRequestParam as X
3338
import qualified Bfx.Data.CancelOrderMulti as CancelOrderMulti
3439
import qualified Bfx.Data.Candles as Candles
40+
import Bfx.Data.Env as X
3541
import qualified Bfx.Data.FeeSummary as FeeSummary
3642
import qualified Bfx.Data.GetOrders as GetOrders
43+
import Bfx.Data.Kind as X
3744
import qualified Bfx.Data.MarketAveragePrice as MarketAveragePrice
3845
import qualified Bfx.Data.SubmitOrder as SubmitOrder
46+
import Bfx.Data.Type as X
3947
import qualified Bfx.Data.Wallets as Wallets
40-
import Bfx.Import
41-
import Bfx.Import.Internal as X
48+
import Bfx.Data.Web as X
4249
import Bfx.Indicator.Atr as X
4350
import Bfx.Indicator.Ma as X
4451
import Bfx.Indicator.Tr as X
52+
import Bfx.Math as X
53+
import Bfx.Parser as X
4554
import qualified Bfx.Rpc.Generic as Generic
55+
import Control.Concurrent (threadDelay)
4656
import qualified Data.Map as Map
4757
import qualified Data.Set as Set
58+
import Functora.Money
59+
import Functora.Prelude
4860

4961
platformStatus ::
5062
( MonadThrow m,

pub/bfx/src/Bfx/Class/FromRpc.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import Bfx.Data.Kind
1010
import Bfx.Data.Type
1111
import qualified Bfx.Data.Wallets as Wallets
1212
import Bfx.Data.Web
13-
import Bfx.Import.External
1413
import Bfx.Math
1514
import Bfx.Parser
1615
import Data.Aeson.Lens
1716
import qualified Data.Map as Map
1817
import qualified Data.Text as T
1918
import qualified Data.Vector as V
19+
import Functora.Money
20+
import Functora.Prelude
2021

2122
class FromRpc (method :: Method) res where
2223
fromRpc :: RawResponse -> Either Text res

pub/bfx/src/Bfx/Class/ToPathPieces.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Bfx.Class.ToRequestParam
99
import qualified Bfx.Data.Candles as Candles
1010
import qualified Bfx.Data.GetOrders as GetOrders
1111
import Bfx.Data.Kind
12-
import Bfx.Import.External
12+
import Functora.Prelude
1313

1414
class ToPathPieces (method :: Method) req where
1515
toPathPieces :: req -> [Text]

pub/bfx/src/Bfx/Class/ToRequestParam.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ module Bfx.Class.ToRequestParam
88
where
99

1010
import Bfx.Data.Web
11-
import Bfx.Import.External
1211
import qualified Data.ByteString as BS
1312
import qualified Data.Text as T
13+
import Functora.Money
14+
import Functora.Prelude
1415
import qualified Prelude
1516

1617
class ToRequestParam a where

pub/bfx/src/Bfx/Data/CancelOrderMulti.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ module Bfx.Data.CancelOrderMulti
55
)
66
where
77

8-
import Bfx.Import
8+
import Bfx.Data.Type
99
import qualified Data.Aeson as A
10+
import Functora.Cfg
11+
import Functora.Money
12+
import Functora.Prelude
1013

1114
data Request
1215
= ByOrderId (Set OrderId)

pub/bfx/src/Bfx/Data/Candles.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ module Bfx.Data.Candles
88
)
99
where
1010

11-
import Bfx.Import
11+
import Bfx.Class.ToRequestParam
12+
import Bfx.Data.Type
1213
import qualified Data.Text as T
14+
import Functora.Prelude
1315
import qualified Prelude
1416

1517
data Section

pub/bfx/src/Bfx/Data/Env.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Bfx.Data.Env
88
where
99

1010
import Bfx.Data.Web
11-
import Bfx.Import.External
1211
import Env
1312
( Mod,
1413
Var,
@@ -19,6 +18,7 @@ import Env
1918
str,
2019
var,
2120
)
21+
import Functora.Prelude
2222

2323
data Env = Env
2424
{ envNonceGen :: NonceGen,

pub/bfx/src/Bfx/Data/FeeSummary.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module Bfx.Data.FeeSummary
77
where
88

99
import Bfx.Data.Type
10-
import Bfx.Import.External
10+
import Functora.Money
11+
import Functora.Prelude
1112

1213
--
1314
-- TODO : this is not 100% correct

pub/bfx/src/Bfx/Data/GetOrders.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module Bfx.Data.GetOrders
99
where
1010

1111
import Bfx.Data.Type
12-
import Bfx.Import
12+
import Functora.Cfg
13+
import Functora.Prelude
1314

1415
data Options = Options
1516
{ currencyPair :: Maybe CurrencyPair,

0 commit comments

Comments
 (0)