Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created February 5, 2024 06:24
Show Gist options
  • Save xuwei-k/5032d6e9e8b72eb332413794ba8461d5 to your computer and use it in GitHub Desktop.
Save xuwei-k/5032d6e9e8b72eb332413794ba8461d5 to your computer and use it in GitHub Desktop.
scalaVersion := "2.13.12"
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.10"
package example
import shapeless.nat._
import shapeless.syntax.std.tuple._
object Main{
def main(args: Array[String]): Unit = {
val t = (2, false, "a")
val x = t.updateAtWith(2)(a => a :: Nil)._2
println(x)
assert(x == (2, false, "a" :: Nil))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment