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

Add Yoneda and CoYoneda, along with their Functor instances #83

Merged
merged 6 commits into from
May 7, 2017

Conversation

pakoito
Copy link
Member

@pakoito pakoito commented Apr 27, 2017

Add two central pieces to the Free machinery: Yoneda and CoYoneda. They include a minimal implementation, along with a Functor instance. I've also written a minimal test suite for each.

For consistency purposes I've swapped the parameter order in the Free class.

Closes #80

@pakoito pakoito self-assigned this Apr 27, 2017
typealias YonedaF<U> = HK<Yoneda.F, U>

// FIXME using YonedaKind throws a compiler error, but not the expanded form
interface Yoneda<FU, A> : HK<HK<Yoneda.F, FU>, A> {
Copy link
Member Author

Choose a reason for hiding this comment

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

A compiler bug, someone call the JB cops :D

Copy link
Member Author

Choose a reason for hiding this comment

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

The bug went away when I tried to compile again to get a debug trace. I've reported it anyway to https://youtrack.jetbrains.com/issue/KT-17619

Copy link
Member Author

@pakoito pakoito May 7, 2017

Choose a reason for hiding this comment

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

The bug came back so I reverted it.

@codecov
Copy link

codecov bot commented May 7, 2017

Codecov Report

Merging #83 into master will increase coverage by 0.65%.
The diff coverage is 76.19%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #83      +/-   ##
===========================================
+ Coverage     47.05%   47.7%   +0.65%     
- Complexity      120     127       +7     
===========================================
  Files            58      62       +4     
  Lines           831     851      +20     
  Branches        131     131              
===========================================
+ Hits            391     406      +15     
- Misses          390     395       +5     
  Partials         50      50
Impacted Files Coverage Δ Complexity Δ
katz/src/main/kotlin/katz/free/Free.kt 67.74% <100%> (ø) 1 <0> (ø) ⬇️
.../src/main/kotlin/katz/instances/CoYonedaFunctor.kt 100% <100%> (ø) 1 <1> (?)
...tz/src/main/kotlin/katz/instances/YonedaFunctor.kt 100% <100%> (ø) 1 <1> (?)
katz/src/main/kotlin/katz/free/Yoneda.kt 62.5% <62.5%> (ø) 0 <0> (?)
katz/src/main/kotlin/katz/free/CoYoneda.kt 75% <75%> (ø) 4 <4> (?)

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 cd5d3e0...662627b. Read the comment docs.

@pakoito pakoito merged commit c8032ee into master May 7, 2017
@pakoito pakoito deleted the paco-coñoneta branch May 7, 2017 10:40
ambrusadrianz pushed a commit to ambrusadrianz/arrow that referenced this pull request Oct 22, 2019
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.

2 participants