Skip to content

Commit d530dd3

Browse files
Removing 'text-short' dependency & pruning other unused dependencies
1 parent 95dae38 commit d530dd3

File tree

11 files changed

+97
-139
lines changed

11 files changed

+97
-139
lines changed

app/implied-align/Main.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Data.Key
1616
import Data.List.NonEmpty (intersperse)
1717
import Data.Semigroup.Foldable
1818
import Data.SymbolString
19-
import Data.Text.Short (ShortText, toString)
19+
import Data.Text (Text, unpack)
2020
import File.Input
2121
import File.Output
2222
import InputParser
@@ -40,13 +40,13 @@ runInput = do
4040
tcm = inputTCM fileInput
4141
tree = inputTree fileInput
4242

43-
maxLabelLen = succ . maximum $ foldMapWithKey (\k _ -> [length $ toString k]) tree
43+
maxLabelLen = succ . maximum $ foldMapWithKey (\k _ -> [length $ unpack k]) tree
4444

45-
inputRenderer :: PreliminaryNode -> ShortText -> String
46-
inputRenderer x i = unwords [ padR maxLabelLen (toString i <> ":"), renderSmartly alphabet $ x ^. preliminaryString ]
45+
inputRenderer :: PreliminaryNode -> Text -> String
46+
inputRenderer x i = unwords [ padR maxLabelLen (unpack i <> ":"), renderSmartly alphabet $ x ^. preliminaryString ]
4747

48-
leafRenderer :: FinalizedNode -> ShortText -> String
49-
leafRenderer x i = unwords [ padR maxLabelLen (toString i <> ":"), padL 5 . show $ x ^. localCost, renderSingleton alphabet $ x ^. alignedString ]
48+
leafRenderer :: FinalizedNode -> Text -> String
49+
leafRenderer x i = unwords [ padR maxLabelLen (unpack i <> ":"), padL 5 . show $ x ^. localCost, renderSingleton alphabet $ x ^. alignedString ]
5050

5151
nodeRenderer :: FinalizedNode -> p -> String
5252
nodeRenderer x _ = unwords [ padR maxLabelLen "?:" , padL 5 . show $ x ^. localCost, renderSingleton alphabet $ x ^. alignedString ]

efficient-implied-alignment.cabal

Lines changed: 20 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ description: Using a commutative, binary string alignment operator and a
2323

2424
homepage: https://github.com/recursion-ninja/efficient-implied-alignment#readme
2525
bug-reports: https://github.com/recursion-ninja/efficient-implied-alignment/issues
26+
27+
tested-with:
28+
GHC == 8.8.4
29+
GHC == 8.10.4
30+
GHC == 9.0.1
2631

2732
extra-source-files:
2833
ChangeLog.md
@@ -80,6 +85,10 @@ common ghc-flags
8085
-Wunused-matches
8186
-Wwrong-do-bind
8287

88+
if impl(ghc >= 8.10)
89+
ghc-options:
90+
-Wderiving-defaults
91+
-Wunused-packages
8392

8493

8594
library
@@ -111,9 +120,7 @@ library
111120
, QuickCheck
112121
, scientific
113122
, semigroupoids
114-
, semigroups
115123
, text >=1.2
116-
, text-short
117124
, transformers
118125
, validation
119126
, vector
@@ -179,15 +186,15 @@ executable implied-align
179186
-- -threaded -rtsopts -with-rtsopts=-N -g
180187

181188
build-depends:
182-
ansi-wl-pprint
189+
efficient-implied-alignment
190+
, ansi-wl-pprint
183191
, base >=4.7 && <5
184-
, efficient-implied-alignment
185192
, deepseq
186193
, keys
187194
, lens
188195
, optparse-applicative
189196
, semigroupoids
190-
, text-short
197+
, text
191198

192199
other-modules:
193200
Paths_efficient_implied_alignment
@@ -205,24 +212,19 @@ executable generate-timings
205212
hs-source-dirs:
206213
app/generate-timings
207214

208-
ghc-options: -g
209-
-- -threaded -rtsopts -with-rtsopts=-N -g
210-
211215
build-depends:
212-
ansi-wl-pprint
216+
efficient-implied-alignment
217+
, ansi-wl-pprint
213218
, base >=4.7 && <5
214-
, efficient-implied-alignment
215219
, containers >=0.5.8
216220
, Decimal
217221
, deepseq
218222
, directory
219223
, filepath
220224
, keys
221-
, lens
222225
, megaparsec >=7.0
223226
, optparse-applicative
224227
, process
225-
, scientific
226228
, semigroupoids
227229

228230
default-language: Haskell2010
@@ -244,22 +246,9 @@ executable newick-add-delete-taxon
244246
-- -threaded -rtsopts -with-rtsopts=-N -g
245247

246248
build-depends:
247-
ansi-wl-pprint
248-
, base >=4.7 && <5
249-
, efficient-implied-alignment
250-
, deepseq
251-
, directory
252-
, filepath
249+
base >=4.7 && <5
253250
, keys
254-
, lens
255-
, megaparsec >=7.0
256-
, MissingH
257-
, optparse-applicative
258-
, process
259-
, scientific
260-
, semigroupoids
261251
, split
262-
, vector
263252

264253
default-language: Haskell2010
265254

@@ -277,25 +266,11 @@ executable draw-pre-order-figure
277266
-- -threaded -rtsopts -with-rtsopts=-N -g
278267

279268
build-depends:
280-
ansi-wl-pprint
281-
, base >=4.7 && <5
282-
, efficient-implied-alignment
283-
, deepseq
284-
, diagrams
269+
base >=4.7 && <5
285270
, diagrams-lib
286271
, diagrams-svg
287-
, directory
288-
, filepath
289272
, keys
290273
, lens
291-
, megaparsec >=7.0
292-
, MissingH
293-
, optparse-applicative
294-
, process
295-
, scientific
296-
, semigroupoids
297-
, split
298-
, vector
299274

300275
default-language: Haskell2010
301276

@@ -309,24 +284,9 @@ executable reduce-fasta
309284
hs-source-dirs:
310285
app
311286

312-
ghc-options: -g
313-
-- -threaded -rtsopts -with-rtsopts=-N -g
314-
315287
build-depends:
316-
ansi-wl-pprint
317-
, base >=4.7 && <5
318-
, efficient-implied-alignment
319-
, deepseq
320-
, directory
321-
, filepath
288+
base >=4.7 && <5
322289
, keys
323-
, lens
324-
, megaparsec >=7.0
325-
, optparse-applicative
326-
, process
327-
, scientific
328-
, semigroupoids
329-
, split
330290

331291
default-language: Haskell2010
332292

@@ -352,7 +312,7 @@ test-suite test-align
352312
, matrices
353313
, pointed
354314
, semigroupoids
355-
, text-short
315+
, text
356316
, validation
357317

358318
other-modules:
@@ -376,7 +336,6 @@ test-suite test-trees
376336
build-depends:
377337
efficient-implied-alignment
378338
, base >=4.7 && <5
379-
, efficient-implied-alignment
380339
, containers >=0.5.8
381340
, deepseq
382341
, keys
@@ -386,7 +345,7 @@ test-suite test-trees
386345
, semigroupoids
387346
, tasty
388347
, tasty-hunit
389-
, text-short
348+
, text
390349
, validation
391350

392351
other-modules:
@@ -411,7 +370,6 @@ test-suite test-suite
411370
efficient-implied-alignment
412371
, base >=4.7 && <5
413372
, bimap
414-
, efficient-implied-alignment
415373
, containers >=0.5.8
416374
, deepseq
417375
, keys
@@ -425,7 +383,7 @@ test-suite test-suite
425383
, tasty-hunit
426384
, tasty-quickcheck
427385
, tasty-smallcheck
428-
, text-short
386+
, text
429387
, validation
430388

431389
other-modules:

src/Data/BTree.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import Data.Bitraversable
1212
import Data.Foldable
1313
import Data.Key
1414
import Data.List.NonEmpty hiding (length, takeWhile)
15+
import Data.Text (Text)
1516
import Data.Semigroup.Foldable
16-
import Data.Text.Short (ShortText)
1717
import Prelude hiding (head)
1818

1919

@@ -26,12 +26,12 @@ data BTree b a
2626

2727
data NodeDatum a
2828
= NodeDatum
29-
{ identifier :: !ShortText
29+
{ identifier :: !Text
3030
, nodeDatum :: !a
3131
} deriving (Eq, Functor)
3232

3333

34-
type instance Key (BTree b) = ShortText
34+
type instance Key (BTree b) = Text
3535

3636

3737
instance Bifunctor BTree where
@@ -116,7 +116,7 @@ getNodeDatum (Leaf (NodeDatum _ x)) = x
116116
getNodeDatum (Internal (NodeDatum _ x) _ _) = x
117117

118118

119-
setLeafLabels :: BTree b a -> BTree b ShortText
119+
setLeafLabels :: BTree b a -> BTree b Text
120120
setLeafLabels (Leaf (NodeDatum i _)) = Leaf $ NodeDatum i i
121121
setLeafLabels (Internal n lhs rhs) = Internal n (setLeafLabels lhs) $ setLeafLabels rhs
122122

@@ -164,22 +164,22 @@ preorder rootTransformation internalTransformation leafTransformation rootNode =
164164

165165

166166
renderPhylogeny
167-
:: (a -> ShortText -> String)
167+
:: (a -> Text -> String)
168168
-> BTree b a
169169
-> String
170170
renderPhylogeny f = horizontalRendering . toBinaryRenderingTree (const (const "")) f
171171

172172

173173
renderAlignment
174-
:: (b -> ShortText -> String)
175-
-> (a -> ShortText -> String)
174+
:: (b -> Text -> String)
175+
-> (a -> Text -> String)
176176
-> BTree b a -> String
177177
renderAlignment f g = horizontalRendering . toBinaryRenderingTree f g
178178

179179

180180
toBinaryRenderingTree
181-
:: (b -> ShortText -> String)
182-
-> (a -> ShortText -> String)
181+
:: (b -> Text -> String)
182+
-> (a -> Text -> String)
183183
-> BTree b a
184184
-> BinaryRenderingTree
185185
toBinaryRenderingTree f g tree =

src/File/Format/Fasta/Internal.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import Data.Char (isSpace)
2525
import Data.String
2626
import qualified Data.Text as T
2727
import qualified Data.Text.Lazy as LT
28-
import Data.Text.Short (ShortText)
2928
import Data.Void
3029
import Text.Megaparsec
3130
import Text.Megaparsec.Char
@@ -34,7 +33,7 @@ import Text.Megaparsec.Custom
3433

3534
-- |
3635
-- Unique identifier for a taxa
37-
type Identifier = ShortText
36+
type Identifier = T.Text
3837

3938

4039
-- |

0 commit comments

Comments
 (0)