serokell / universum

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

Rename 'Container' and 'NonTrivialContainer' #80

Closed chshersh closed 6 years ago

chshersh commented 6 years ago

Names Contaner and NonTrivialContainer for our Foldable-like type classes were invented most-likely without feeling that we will still use universum in 2017... But it's a fact. And I feel like we need to invent better names. We should discuss it. You can propose your replacements. But here are mine:

For Container

  1. ToList
  2. LikeList
  3. Listable
  4. Sequence
  5. IsSequence (like in mono-traversable)
  6. MonoList

For NonTrivialContainer

  1. MonoFoldable (like in mono-traversable)
  2. Sequence
  3. IsSequence
  4. ListContainer
  5. ListSequence
  6. SequenceList

I like ToList and MonoFoldable more. Your suggestions?

@neongreen @gromakovsky @int-index @Martoon-00

neongreen commented 6 years ago

ToList and Container. I don't like MonoFoldable because it's taken by a popular package.

chshersh commented 6 years ago

@neongreen You're right, I also don't want to be associated with famous package (though I like the name).

Martoon-00 commented 6 years ago

I'm really glad that you're going to rename these ones. But whatever names you will choose eventually, please remain aliases for old ones. I have several personal projects which use universum, and am highly interested in bumping base library without code migrations

chshersh commented 6 years ago

@Martoon-00 Well, if we rename NonTrivialContainer to Container then it's difficult to keep Container alias for old Container which will be renamed to ToList...

Martoon-00 commented 6 years ago

Yeah, that would be sad. However strengthening constraint here should be ok in most cases

chshersh commented 6 years ago

@Martoon-00 What do you mean by saying strengthening constraint?

Martoon-00 commented 6 years ago

If previously I had a function

f :: Container list => ...

then after bumping universum with renaming, Container would become more strong constraint and f would still compile. At the same time, most types which currently implement Container do implement NonTrivialContainer as well, so use cite of f where I instantiate list would most probably stay compiling as well

chshersh commented 6 years ago

Okay, let it be ToList and Container.