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

Move Optics std to companion objects #888

Merged
merged 34 commits into from
Jun 26, 2018
Merged

Conversation

nomisRev
Copy link
Member

Like it was done for generated Optics in #825 this PR moves the Optics of the std to the companion objects of the respective data types.

@pakoito
Copy link
Member

pakoito commented Jun 14, 2018

I see you've created new Api objects for List and such. Rather than having a new one just for this library, it'd be better if we added an object in one of the core or data modules, and add your extfuns from the optics module.

That way the object can be extended by all modules, and we centralise all the APIs.

@codecov
Copy link

codecov bot commented Jun 14, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #888   +/-   ##
=========================================
  Coverage          ?   45.38%           
  Complexity        ?      652           
=========================================
  Files             ?      302           
  Lines             ?     7745           
  Branches          ?      833           
=========================================
  Hits              ?     3515           
  Misses            ?     3924           
  Partials          ?      306
Impacted Files Coverage Δ Complexity Δ
...ics/src/main/kotlin/arrow/optics/instances/setk.kt 100% <ø> (ø) 0 <0> (?)
...tics/src/main/kotlin/arrow/optics/instances/set.kt 100% <ø> (ø) 0 <0> (?)
...s/src/main/kotlin/arrow/optics/instances/option.kt 100% <ø> (ø) 0 <0> (?)
...tics/src/main/kotlin/arrow/optics/instances/try.kt 100% <ø> (ø) 0 <0> (?)
...s/src/main/kotlin/arrow/optics/instances/either.kt 100% <ø> (ø) 0 <0> (?)
...-optics/src/main/kotlin/arrow/optics/dsl/option.kt 0% <0%> (ø) 0 <0> (?)
...s/src/main/kotlin/arrow/optics/instances/string.kt 100% <100%> (ø) 0 <0> (?)
...ics/src/main/kotlin/arrow/optics/instances/mapk.kt 86.36% <100%> (ø) 0 <0> (?)
...main/kotlin/arrow/optics/instances/nonemptylist.kt 86.66% <50%> (ø) 0 <0> (?)
...rc/main/kotlin/arrow/optics/instances/sequencek.kt 83.33% <66.66%> (ø) 0 <0> (?)
... and 3 more

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 12bfc77...e53b8f2. Read the comment docs.

@nomisRev
Copy link
Member Author

@pakoito I made the changes 👍

@@ -0,0 +1,3 @@
package arrow.instances

object ListInstances
Copy link
Member

Choose a reason for hiding this comment

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

Could you please put this file in arrow-data instead? That way we don't need to depend on the instances package when adding other typeclasses to List.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't these go to arrow-core?

Copy link
Member

Choose a reason for hiding this comment

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

It's cheap so why not :D

object SetInstances
Copy link
Member

@pakoito pakoito Jun 24, 2018

Choose a reason for hiding this comment

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

Same as ListInstances! We could also add the others: Map, SortedMap, and SortedSet.

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.

Approved with one suggestion!

@nomisRev nomisRev force-pushed the simon-std-on-companion branch from 0a361f0 to dd0b002 Compare June 25, 2018 21:43
@nomisRev nomisRev merged commit 3109e7c into master Jun 26, 2018
@nomisRev nomisRev deleted the simon-std-on-companion branch June 26, 2018 08:45
nomisRev added a commit that referenced this pull request Jun 26, 2018
Move Optics std to companion objects (#888)

Like it was done for generated Optics in #825 this PR moves the Optics of the std to the companion objects of the respective data types.
RawToast pushed a commit to RawToast/kategory that referenced this pull request Jul 18, 2018
Like it was done for generated Optics in arrow-kt#825 this PR moves the Optics of the std to the companion objects of the respective data types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants