Deprecate @higherkind & @extension for Sequence/SequenceK #329
Conversation
franciscodr
commented
Feb 5, 2021
- Align
- Alternative
- Applicative
- Apply
- Crosswalk
- Eq (EqK)
- Foldable
- Functor
- FunctorFilter
- Monad
- MonadCombine
- MonadFilter
- MonadLogic
- MonadPlus
- Monoid (MonoidK)
- Monoidal
- Repeat
- Semialign
- Semigroup (SemigroupK)
- Semigroupal
- Traverse
- Unalign
- Unzip
- Zip
@@ -148,8 +138,7 @@ fun <A> Sequence<A>.optional(): Sequence<Option<A>> = | |||
@Deprecated( | |||
"@extension kinded projected functions are deprecated", | |||
ReplaceWith( | |||
"guard(arg0)", | |||
"arrow.core.extensions.sequence.alternative.Sequence.guard" | |||
"if (arg0) sequenceOf(Unit) else emptySequence()" |
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.
should we be promoting in these replacements apis we are providing such as Sequence.unit
otherwise we should question if Sequence.unit
has value over sequenceOf(Unit)
?
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.
We can't do Sequence.unit
since we don't own Sequence
, right?
I frequently use Either.unit()
if I need to use Either
in some kind of loop, and it's become a habit to use Either.unit()
whenever I need Right(Unit)
. In general, however, I'd say that it's probably not very useful since it's a micro-optimization.
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.
Looks good to me. A couple of small things that need to be fixed added as suggestions.
Must've felt like a never-ending task 🙈 Thank you @franciscodr!
arrow-core/src/main/kotlin/arrow/core/extensions/sequence/eqK/SequenceKEqK.kt
Outdated
Show resolved
Hide resolved
arrow-core/src/main/kotlin/arrow/core/extensions/sequence/monoid/SequenceKMonoid.kt
Outdated
Show resolved
Hide resolved
arrow-core/src/main/kotlin/arrow/core/extensions/sequencek/eqK/SequenceKEqK.kt
Outdated
Show resolved
Hide resolved
arrow-core/src/main/kotlin/arrow/core/extensions/sequencek/monoid/SequenceKMonoid.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
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.
All comments were addressed. Thanks @franciscodr 👍 👏 👏
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.
thanks @franciscodr !