serokell / universum

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

Investigate issues with 'universum' in stackage nightly snapshot #159

Closed chshersh closed 6 years ago

chshersh commented 6 years ago

Somehow universum-1.1.0 is not in latest Stackage Nightly:

This means that probably universum doesn't build with GHC-8.4.1 which is both sad and strange at the same time.

vrom911 commented 6 years ago

This is due to text-format (see #157) . What should be done about it? I think that something is going on in fmt so we can make #158 .

chshersh commented 6 years ago

@vrom911 I completely forgot about issues with text-format. Yeah, text-format should be replaced. I'd prefer to replace it with fmt instead of formatting by various reasons. Currently something is going on in fmt to resolve this issue:

chshersh commented 6 years ago

Well, another option to resolve this issue: don't depend on any formatting library and don't reexport Buildable type class.

Pros

  1. Make universum even lighter.
  2. Don't force universum users to specific formatting library. Since every library has its own Buildable and community don't have agreement on single fit-to-everyone Buildable type class this might be the right choice.

Cons

  1. You need to export Buildable type class manually.
  2. You need to change usages of pretty and prettyL to something new.

It looks like better solution for this problem to me.

@vrom911 @neongreen @gromakovsky @brandonhamilton what do you think about this?

UPDATE: Added Cons with pretty function.

brandonhamilton commented 6 years ago

The current version of fmt is just re-exporting Buildable from formatting. Unless the other functions from fmt are also going to be exposed in universum, just switching to fmt does not gain any benefit over #158 at the moment (but would be beneficial after aelve/fmt#21 is completed). Either of these will be the path of least change to being buildable with ghc-8.4 and getting back into stackage-nightly.

I support your solution to remove Buildable, although that would lead to breaking change for users of the universum library as you have mentioned.

gromakovsky commented 6 years ago

Well, another option to resolve this issue: don't depend on any formatting library and don't reexport Buildable type class.

What about pretty? That function is cool, isn't it?

chshersh commented 6 years ago

although that would lead to breaking change for users of the universum library as you have mentioned.

Well, reexporing Buildable from other place is also a breaking change...

What about pretty? That function is cool, isn't it?

In fmt library pretty is just fmt function. I think that it's formatting libraries who should care about having such nice functions to convert from Buildable into some text.

neongreen commented 6 years ago

I pinged Chris again

neongreen commented 6 years ago

formatting-6.3.4 released! now I need to release new fmt

neongreen commented 6 years ago

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

chshersh commented 6 years ago

I'm not sure which solution is better...

  1. Replace text-format with formatting.
  2. Replace text-format with fmt.
  3. Remove text-format at all.

At the same time I want to make this decision ASAP so universum can appear in stable LTS with GHC-8.4.1 :running_man:

gromakovsky commented 6 years ago

In fmt library pretty is just fmt function. I think that it's formatting libraries who should care about having such nice functions to convert from Buildable into some text.

Well, what I wanted to say is that in your Cons you probably forgot about pretty, removal of which is probably even worse than Buildable, because I can't import it from another place, so it's more breaking change (I see that I can import fmt instead, but it requires more changes). Of course it's not a fatal problem, just one more problem you didn't mention.

volhovm commented 6 years ago

I think that formatting library should not be a part of prelude anyway, so I vote for (3).