fp-ts: Suggestions for breaking changes for next release
This issue tracks suggestions with breaking changes to be included in the next release.
- Ordering: replace string literal union with numeric enum
//now
type Ordering = 'LT' | 'EQ' | 'GT';
//changes to
enum Ordering = {
LT = -1,
EQ = 0,
GT = 1
}
This removes the need to manually convert ordering values when using in native comparators.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 36 (19 by maintainers)
I’m quite excited. The new encoding (*) is pretty verbose but
(*) https://github.com/gcanti/fp-ts/blob/1449506613c7d19e0d88023dc93ff6c34ffdeba4/src/Functor.ts#L10-L33
Agree, I always do the same if I need to force explicit type argument
@raveclassic so this is my broad agenda
1.0.0
branch right now (if anyone want to follow the progress)1.0.0-rc
version in thenext
channelBUT
I’m eager to experiment with these 2 new features
As soon as they will be merged on master and will be available on
typescript@next
, I’ll do some experiments to see if I can come up with a better encoding of HKTs (in the working branch is improved but there’s an annoying explosion of interfaces).If that’s the case, I would postpone the breaking change release (unless we want to tolerate 2 breaking change versions in a row)
Anothe proposal: swap arguments of
Functor
,Chain
(maybe others)from
to
Why?
Here’s my list so far
Since funxfix already does that, I’m ok with the
L
conventionMost notable change: instance members are no more exported as top level functions so instead of
you must write
@raveclassic I would change to
instead, enums look unsafe
@raveclassic yeah, it has been a very nice experiment (Flow is great with respect to type inference and HKT support) but I’m not a Flow user and my professional interest is pretty low. After some weeks of maintenance I think it doesn’t worth to keep the definition files here, there’s flow-typed for that
Another one:
no prettier comments required and (AFAIK) they don’t show up in quick info