-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typealiases for public APIs datatypes #442
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.
Looks awesome but needs rebasing. Also I think we should not alias Eval
types since those are not ment to be used directly but through the provided functions
@@ -1,5 +1,8 @@ | |||
package kategory | |||
|
|||
typealias Some<A> = Option.Some<A> |
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.
Why don't you just declare Some
and None
as top level?
Same is applicable to Left
, Right
and so on
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.
Well I think we need a consistent API with all types inside their container. For example, Ior
and Either
have Left
and Right
types, and you can call them as Either.Right
and Ior.Right
without conflicts, also you should be able to call Some
as Option.Some
or just Some
.
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.
What's the point of typealiases then? Name clashing can be avoided by fully qualified imports. Long imports can be avoided by short package names :)
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.
@artem-zinnatullin We want commonly used types available at the top level kategory.*
package since many users will just import kategory.*
to obtain syntax and type class instances. Users wanting just a subset of Kategory can still import a la carte types already and that will not change.
Codecov Report
@@ Coverage Diff @@
## master #442 +/- ##
=========================================
Coverage 36.25% 36.25%
Complexity 320 320
=========================================
Files 174 174
Lines 4821 4821
Branches 523 523
=========================================
Hits 1748 1748
Misses 2925 2925
Partials 148 148
Continue to review full report at Codecov.
|
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 so much @tonilopezmr !
Added typealiases for the following datatypes:
Some
andNone
Valid
andInvalid
Failure
andSuccess
Right
andLeft
Closes #300