-
Notifications
You must be signed in to change notification settings - Fork 454
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
kategory-docs
module and proposed layout including Functor
and Applicative
#191
Conversation
…pes with `Functor` as example
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
=========================================
Coverage ? 49.25%
Complexity ? 231
=========================================
Files ? 108
Lines ? 2410
Branches ? 285
=========================================
Hits ? 1187
Misses ? 1113
Partials ? 110
Continue to review full report at Codecov.
|
|
||
### Data types | ||
|
||
Thw following datatypes in Kategory provide instances that adhere to the `Applicative` typeclass. |
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.
typo The
Looks like detekt is not very good friends with gradle API?
Does it run correctly in your machine @raulraja ? Mine still has Windows only issues with detekt |
@wiyarmir never seen that error before. |
|
||
In the following example we will define 3 invocations that may as well be remote or local services each one of them returning different results in the same computational context of `Option` | ||
|
||
```kotlin:ank |
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.
so is ank
parsing this snippets and compiling them to fail CI if docs snippets are not compiling for any reason ?
And what about the docs autogeneration ? Can't see anything related on this PR. Don't we still have that ready ?
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.
yes ank does all of that , the generated docs will be in markdown format which jekyll's support so you can push them to ghpages or anywhere else.
…o 0.18 and kategory annotations version to 0.3.7
permalink: /docs/typeclasses/applicative/ | ||
--- | ||
|
||
## Functor |
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 header has to be Applicative.
I believe we should add, very close to the top, which other typeclasses do each inherit from. It's easy to miss that Applicative inherits from Functor, so it gets map by default. |
|
||
Apply a function inside the type constructor's context | ||
|
||
`fun <A, B> ap(fa: HK<F, A>, ff: HK<F, (A) -> B>): HK<F, B>` |
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 is the most generic example of the API. We should display some implementation examples below, i.e. the same for Option or Either. Not the implementation, just the signature with the generics pre-applied.
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 are examples below of usage. Adding a concrete form using for example OptionKind
it's going to generate more confusion since we will have to explain here what kinds are. This can be better addressed in the derivation section or a section where we explain how we use higher kinds and how we have emulated them.
|
||
### Laws | ||
|
||
Kategory provides [`ApplicativeLaws`](/docs/typeclasses/laws#applicativelaws) for internal verification of lawful instances and third party apps creating their own Applicative instances. |
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 should flesh out the explanation for laws, or at least use the term test or test suite to refer to them, as that relates more to coding concepts.
# Conflicts: # build.gradle # kategory/src/test/kotlin/kategory/data/OptionTest.kt # settings.gradle
… by ank for the time being.
# Conflicts: # build.gradle
kategory-docs
module and proposed layout including Functor
kategory-docs
module and proposed layout including Functor
and Applicative
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.
Let's go live with them!
Co-authored-by: Rachel M. Carmena <[email protected]>
Co-authored-by: Tavish Pegram <[email protected]>
Let's agree on an standard format for the datatypes and typeclasses section so we can write the rest.
See the included
Functor
example.