serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 28 forks source link

Consider replacing text-format dependency #157

Closed brandonhamilton closed 6 years ago

brandonhamilton commented 6 years ago

text-format does not currently compile with ghc-8.4 and appears to be unmaintained. Due to this it is no longer included in the latest stackage-nightly.

It seems that dhall has taken the route of replacing this dependency with the formatting library, which appears to offer a drop-in replacement for Data.Text.Buildable.

chshersh commented 6 years ago

Hi, @brandonhamilton! Unfortunately, migration to formatting is not possible at this moment.

formatting package has more dependencies than text-format which is kinda sad for custom prelude.

But most importantly: universum is used in one of the biggest projects — cardano-sl. And moving this project from text-format to formatting is a huge work. Especially when migration to GHC-8.4.1 won't happen for a long time.

Also, I don't want to use formatting library for formatting. We have text-format in dependencies for universum only because we need Buildable instances for some formatting library. But it's suggested to use fmt package for formatting because it's better. Maybe one day we will replace text-format with fmt in universum. Ping @neongreen for details.

I would like to have Buidable type class bundled with text package. I even opened an issue for this:

But looks like this won't happen soon as well.

Another possibilty: migrate to display package, which contains only Buildable type class and nothing redundant.

But this involves migration of fmt to Display type class as well which is not possible because there's no IsString instance for ByteString Builder at the moment:

I opened issue for this as well:

brandonhamilton commented 6 years ago

Great, thanks for this!

I am using universum in most of my projects, and text-format seems to be the blocker for migrating to ghc 8.4 :(

chshersh commented 6 years ago

I am using universum in most of my projects

Wow, that's nice to hear! I didn't imagine that people outside @Serokell use universum as a custom prelude. That's really motivating to continue doing this project better :muscle: If you use stack build and don't publish your packages to Hackage, you can use github dependency from your fork.

I would like @neongreen to join this conversation. I've created issue for this:

I can keep your PR open in case this problem can be solved somehow in nearest future.

neongreen commented 6 years ago

@brandonhamilton if you can make a PR to address https://github.com/aelve/fmt/issues/17 (nothing complicated), we can probably be done with that in no time.

neongreen commented 6 years ago

https://hackage.haskell.org/package/fmt-0.6