Cats: ReaderWriterStateT type parameter order

Created on 9 Jul 2017  路  5Comments  路  Source: typelevel/cats

I mentioned this in #1706, but that PR was merged before we decided on what to do.

Quoting myself :

I also find the ordering of the type parameters a bit confusing. Now it is E (Reader) -> S (State) -> L (Writer), while the name ReaderWriterStateT suggests that Writer comes before State. The reason is probably the Bifunctor instance for the Writer part.

I would drop the Bifunctor instance and switch the order of S and L so it aligns with the name. We could also leave as it is or change to ReaderStateWriterT :smiley:. If we want to change something, it should probably be done before 1.0.0-MF. Opinions?

_I won't be able to work on this before the 16th, so feel free to pick this up._

Most helpful comment

In my opinion, there is some value in the recognizability of the ReaderWriterStateT name. ReaderStateWriterT trips me up quite a bit, even if there is a good argument that the name order is better than the original. I have no opinion on the Bifunctor instance.

All 5 comments

I vote for renaming to ReaderStateWriterT

I'd personally prefer to have it as RWS (as that is how it's commonly known as) and drop the Bifunctor. I don't really think the Bifunctor instance is all that important for RWS.

In my opinion, there is some value in the recognizability of the ReaderWriterStateT name. ReaderStateWriterT trips me up quite a bit, even if there is a good argument that the name order is better than the original. I have no opinion on the Bifunctor instance.

Agreed, but my opinion is to remove the Bifunctor instance because it's probably not really useful; ultimately it's arbitrary anyway, should be a Trifunctor ;)

okay it makes more sense to drop the Bifunctor and keep the name. PR incoming.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kailuowang picture kailuowang  路  3Comments

LukaJCB picture LukaJCB  路  3Comments

kailuowang picture kailuowang  路  5Comments

LukaJCB picture LukaJCB  路  4Comments

adelbertc picture adelbertc  路  5Comments