Skip to content

Commit 45aeb73

Browse files
authored
Merge pull request #15 from tofu-tf/feature/tuple-optics
Optics for TupleN
2 parents 177a54c + 6d430f7 commit 45aeb73

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Publish._, Dependencies._
22
import com.typesafe.sbt.SbtGit.git
33
import sbt.ModuleID
4+
import spray.boilerplate.BoilerplatePlugin
45

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

4344
lazy val opticsCore = project
4445
.in(file("modules/core"))
46+
.enablePlugins(BoilerplatePlugin)
4547
.settings(
4648
defaultSettings,
4749
libraryDependencies ++= Seq(catsCore, alleycats),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package glass
2+
3+
package object tuples {
4+
[#implicit class Tuple1Exts(val tpl: Tuple1.type) extends AnyVal {
5+
[#def _1[[#T1#]]: Contains[Tuple1[[#T1#]], T1] =
6+
Contains((tpl: Tuple1[[#T1#]]) => tpl._1)((tpl: Tuple1[[#T1#]], v1: T1) => tpl.copy(_1 = v1))#
7+
]
8+
}#
9+
10+
]
11+
}

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
2525
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
2626

2727
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.2")
28+
29+
addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.6.1")

0 commit comments

Comments
 (0)