Namely:
As a functional library it's OK to enforce immutability.
I would get rid of all Readonly* modules and make the rest immutable.
Would love to see that readonly is the default in the whole fp-ts ecosystem but I already had my struggle to switch to the readonly instances with fp-ts@2 because fp-ts-contrib, io-ts-types and monocle-ts has not full readonly support. If we could add the readonly instances e. g. ReadonlyZipper for fp-ts-contrib, readonlyNonEmptyArray for io-ts-types and indexReadonlyNonEmptyArray for monocle-ts I would already give it a try.
and indexReadonlyNonEmptyArray for monocle-ts
@mlegenhausen https://github.com/gcanti/monocle-ts/pull/124
I would get rid of all Readonly* modules and make the rest immutable
There are two options I guess:
Option 1
Keep the Readonly* modules and simply remove the mutable counterparts (:+1: if you prefer this option)
Option 2
Remove all the mutable modules and rename Readonly<X> module to <X> (:-1: if you prefer this option)
@gcanti based on a similar conversation...
this explains my vote :)
We can see this issue in two lights:
Readonly prefix. We'll have one Array module which is readonly....or:
Readonly all immutable data-structures. This is aligned with the current situation, in which we have both mutable Array and immutable ReadonlyArray.I tend to like the first philosophy.
Most helpful comment
We can see this issue in two lights:
Readonlyprefix. We'll have oneArraymodule which is readonly....or:
Readonlyall immutable data-structures. This is aligned with the current situation, in which we have both mutableArrayand immutableReadonlyArray.I tend to like the first philosophy.