Clean up constructors Arrow Core Datatypes. #344
Conversation
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 @nomisRev!
@@ -183,7 +183,7 @@ sealed class Eval<out A> : EvalOf<A> { | |||
fun raise(t: Throwable): Eval<Nothing> = | |||
defer { throw t } | |||
|
|||
val unit: Eval<Unit> = Now(kotlin.Unit) | |||
val Unit: Eval<Unit> = Now(kotlin.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.
This was uppercased on 0.11.0
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.
Do we want those to be upper-cased or lowercased in Arrow for other libs and API's?
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.
Good point @i-walker! After comparing with the other (smart) constructors in Arrow, I think we should deprecate all of these in favor of their right hand side implementations.
val Unit: Eval<Unit> = Now(kotlin.Unit)
val True: Eval<Boolean> = Now(true)
val False: Eval<Boolean> = Now(false)
val Zero: Eval<Int> = Now(0)
val One: Eval<Int> = Now(1)
If all agree I can add this change in this PR as well.
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.
I am sorry, I saw the reply after merging it.
Let's move that to a different PR 😄
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 @nomisRev 🙌 , left a general question below on naming conventions.
This PR deprecates up all duplicated constructors, and deprecates all
just
constructors.This leaves behind only the actual constructors, and the extension constructors.
All constructors of Either after removal of deprecated methods: