Deprecates Kind and its associated type class types. #281
Conversation
Are we still continuing a kind based api somewhere? Kinds have their fair share of uses in some more obscure but nevertheless useful parts of fp, for example some recursion schemes need it. If not I'll just port them somewhere else anyway at some point, just wanted to know before committing to it^^ |
@1Jajen1 The current plan is to deprecate kinds across the board because it forces users into |
Yes I get why kinds are being removed, tho there are patterns that cannot be expressed without them and I am fine with not having those patterns around core. Recursion schemes need kinds in the api and free like structures are easier to model with them as well (thinking of Free selectives/Free applicatives here. Use case being statically optimized data fetching, parsing and such). So this can go two ways I think: Either we keep kinds in a with meta only section of arrow or I'll at some point maintain a lib with that myself, tbh I don't really have any opinion on what is better, just asking for some thoughts on this. I in no way think that we should offer a kind based api as we have atm, just the bits needed to make recursion schemes and other use cases usable. |
@1Jajen1 Happy new year! |
# Conflicts: # arrow-core-data/src/main/kotlin/arrow/typeclasses/Applicative.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/ApplicativeError.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Bifoldable.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Bimonad.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Bitraverse.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Category.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Contravariant.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Invariant.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/MonadCombine.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/MonadError.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/MonadFilter.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Profunctor.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Selective.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/SemigroupK.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/Traverse.kt # arrow-core-data/src/main/kotlin/arrow/typeclasses/TraverseFilter.kt
} | ||
|
||
@RestrictsSuspension | ||
object unsafe { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go through a deprecation cycle in core directly. Moving it to Arrow Fx would still be a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 🙌
This PR deprecates the Kind interface, its aliases and all type classes that have kinded types.
After a few years with emulated kinds in arrow the user burden and proliferation of
fix
all over user code has made us decide and push toward removing this emulation from the library. We decided to go in favor of concrete member and extensions that offer the same functionality but better ergonomics.For this reason Kind polymorphism is no longer supported but effect and other forms of polymorphism are available through basic type classes, fun interface and the ability for users to define operators in computation builders such as monad invoke.
Other PRs like #272 are being done for each data type extensions and members remaining in Arrow core.