Skip to content
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

Merged
merged 18 commits into from
Aug 31, 2017

Conversation

raulraja
Copy link
Member

@raulraja raulraja commented Aug 13, 2017

Let's agree on an standard format for the datatypes and typeclasses section so we can write the rest.
See the included Functor example.

@codecov-io
Copy link

codecov-io commented Aug 13, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@8e35d6d). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #191   +/-   ##
=========================================
  Coverage          ?   49.25%           
  Complexity        ?      231           
=========================================
  Files             ?      108           
  Lines             ?     2410           
  Branches          ?      285           
=========================================
  Hits              ?     1187           
  Misses            ?     1113           
  Partials          ?      110
Impacted Files Coverage Δ Complexity Δ
...ry/src/main/kotlin/kategory/typeclasses/Functor.kt 20% <0%> (ø) 0 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e35d6d...3886388. Read the comment docs.


### Data types

Thw following datatypes in Kategory provide instances that adhere to the `Applicative` typeclass.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo The

@wiyarmir
Copy link
Member

Looks like detekt is not very good friends with gradle API?

> Could not get unknown property 'kotlinxCollectionsImmutableVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Does it run correctly in your machine @raulraja ? Mine still has Windows only issues with detekt

@raulraja
Copy link
Member Author

@wiyarmir never seen that error before.

@pakoito
Copy link
Member

pakoito commented Aug 16, 2017

@raulraja @wiyarmir That one is my fault. We weren't using the lib so I removed it from all dependencies. Maybe it carried over while copying the new module.

https://github.com/kategory/kategory/pull/200/files#diff-c197962302397baf3a4cc36463dce5eaR27

https://github.com/kategory/kategory/pull/200/files#diff-21d747ac01136f734b4bc99b4f3735d1L9


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
Copy link
Member

@JorgeCastilloPrz JorgeCastilloPrz Aug 17, 2017

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 ?

Copy link
Member Author

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.

permalink: /docs/typeclasses/applicative/
---

## Functor
Copy link
Member

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.

@pakoito
Copy link
Member

pakoito commented Aug 27, 2017

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>`
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

@raulraja raulraja changed the title kategory-docs module and proposed layout including Functor kategory-docs module and proposed layout including Functor and Applicative Aug 31, 2017
Copy link
Member

@pakoito pakoito left a 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!

@raulraja raulraja merged commit cf053de into master Aug 31, 2017
@raulraja raulraja deleted the rr-docs-draft branch August 31, 2017 10:03
@wiyarmir wiyarmir mentioned this pull request Sep 15, 2017
rachelcarmena pushed a commit to arrow-kt/arrow-site that referenced this pull request Feb 20, 2020
rachelcarmena added a commit that referenced this pull request Feb 24, 2021
Co-authored-by: Rachel M. Carmena <rachelcarmena@users.noreply.github.com>
rachelcarmena pushed a commit that referenced this pull request Feb 24, 2021
Co-authored-by: Tavish Pegram <tapegram@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants