Skip to content

Commit

Permalink
Merge pull request #15 from tofu-tf/feature/tuple-optics
Browse files Browse the repository at this point in the history
Optics for TupleN
  • Loading branch information
danslapman authored Sep 2, 2022
2 parents 177a54c + 6d430f7 commit 45aeb73
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Publish._, Dependencies._
import com.typesafe.sbt.SbtGit.git
import sbt.ModuleID
import spray.boilerplate.BoilerplatePlugin

lazy val setMinorVersion = minorVersion := {
CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down Expand Up @@ -42,6 +43,7 @@ lazy val defaultSettings = Seq(

lazy val opticsCore = project
.in(file("modules/core"))
.enablePlugins(BoilerplatePlugin)
.settings(
defaultSettings,
libraryDependencies ++= Seq(catsCore, alleycats),
Expand Down
11 changes: 11 additions & 0 deletions modules/core/src/main/boilerplate/glass/tuples/package.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package glass

package object tuples {
[#implicit class Tuple1Exts(val tpl: Tuple1.type) extends AnyVal {
[#def _1[[#T1#]]: Contains[Tuple1[[#T1#]], T1] =
Contains((tpl: Tuple1[[#T1#]]) => tpl._1)((tpl: Tuple1[[#T1#]], v1: T1) => tpl.copy(_1 = v1))#
]
}#

]
}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.2")

addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.6.1")

0 comments on commit 45aeb73

Please sign in to comment.