Skip to content
This repository has been archived by the owner on Sep 15, 2019. It is now read-only.

Optimize 'serokell-util' dependencies #34

Open
12 of 14 tasks
chshersh opened this issue Jan 10, 2018 · 2 comments
Open
12 of 14 tasks

Optimize 'serokell-util' dependencies #34

chshersh opened this issue Jan 10, 2018 · 2 comments

Comments

@chshersh
Copy link

chshersh commented Jan 10, 2018

serokell-util has a lot of dependencies which make it not pleasant to use in most of the projects. What can be optimized:

  • acid-state & safecopy: issue Move 'acid-state' utils into our own fork of 'acid-state' #23
  • time-unts: issue Move 'threadDelay' and 'time-units' utils into separate package #22
  • formatting & text-format: issues Deprecate some useless functions in 'Serokell.Util.Text' #29, Switch from 'text-format' to 'Display' #40. Also described below.
  • ansi-terminal: do we really need this module? Looks like we need.
  • parsec: should move utility function into cardano-sl.
  • semigroups: Semigroup type class is in base now.
  • QuickCheck & quickcheck-instances: it's better to use Hedgehog library nowadays cardano-sl still uses QuickCheck.
  • yaml: we have aeson, it should be sufficient. And I don't really understand why we need yaml..
  • lens: better to replace it with microlens-* family. We need lens due to isomorphisms.
  • log-warper: it's a shame that serokell-util depends on log-warper. It should be vice versa. This was done this way because we want log-warper to be small and serokell-util was too heavy... After dependencies are optimized, we can use serokell-util in log-warper again. Looks like serokell-util is not going to be smaller any time soon.
  • monad-control: is this function really used in many projects? MonadBaseControl is anti-pattern in general. And I don't think it worth it to have this function in serokell-util.
  • extra: we have universum, I think it should be enough.
  • base16-bytestring & base64-bytestring: I guess those formatters can be moved directly into base*-* libraries or in fmt package.
  • optparse-applicative: looks to me that last version of optparse-applicative contains everything we have in serokell-uti. Also see below.

For reference:

$ stack list-dependencies | wc -l
103
DanielRrr pushed a commit that referenced this issue Feb 21, 2018
DanielRrr pushed a commit that referenced this issue Feb 23, 2018
DanielRrr pushed a commit that referenced this issue Feb 23, 2018
DanielRrr pushed a commit that referenced this issue Feb 23, 2018
This reverts commit eae19f9.
DanielRrr pushed a commit that referenced this issue Feb 23, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
DanielRrr pushed a commit that referenced this issue Feb 26, 2018
chshersh pushed a commit that referenced this issue Feb 26, 2018
* erased redundant dependencies from serokell-util.cabal #34

* deleted ../Util/Base.hs and monad-control #34

* erased some rubbish from OptParse.hs #34

* erased fromStr from src/Serokell/Util/OptParse.hs and erased not-needed deps in serokell-util.cabal #34

* resolve conflict #34

* updated CHANGES.md #34
@chshersh
Copy link
Author

chshersh commented Feb 26, 2018

Okay, since most bardaq and svalka is polished, here I will describe more detailed way to cleanup dependencies:

  • optparse-applicative and parsec can be removed by moving fromParsec function into cardano-sl directly.
  • yaml: confirmed. I18N module ca be safely removed.
  • base-16 formatters are in fmt library. There's pending issue regarding base-16 decoding: Add 'decodeEither' function haskell/base16-bytestring#6
  • base-64 formatters are in fmt library. JsonByteStringDeprecated should be removed. Decoding can't be removed because we need JsonByteString newtype.
  • formatting remove is more difficult. First, we need to compare formatters in Text module with what fmt can give us.

@chshersh
Copy link
Author

chshersh commented Mar 3, 2018

Looks like WrappedM type class can be removed as well. It's not really needed. And we can replace lens with microlens.

DanielRrr pushed a commit that referenced this issue Mar 3, 2018
DanielRrr pushed a commit that referenced this issue Mar 5, 2018
DanielRrr pushed a commit that referenced this issue Apr 17, 2018
remove optparse-appicative from dependecies and OptParse.hs #34

remove JsonByteStringDeprecated from src/Serokell/Util/Base64.hs #34

lens -> microlens #34

[SRK-91] reimplementations in src/Serokell/Util/Base16.hs and src/Serokell/Util/Base64.hs #34
chshersh pushed a commit that referenced this issue Apr 17, 2018
* erased yaml from serokell-util #34

remove optparse-appicative from dependecies and OptParse.hs #34

remove JsonByteStringDeprecated from src/Serokell/Util/Base64.hs #34

lens -> microlens #34

[SRK-91] reimplementations in src/Serokell/Util/Base16.hs and src/Serokell/Util/Base64.hs #34

* Remove aeson-options from dependencies

* Prettify microlens dependencies and usage

* Final dependency cleanup

* Trying to fix Travis CI
@vrom911 vrom911 removed their assignment May 16, 2018
@chshersh chshersh removed their assignment Aug 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants