Skip to content

Instantly share code, notes, and snippets.

@julien-truffaut
Created October 25, 2015 15:24
Show Gist options
  • Save julien-truffaut/36eda0ccde25c202d771 to your computer and use it in GitHub Desktop.
Save julien-truffaut/36eda0ccde25c202d771 to your computer and use it in GitHub Desktop.
import monocle.MonocleSuite
import monocle.generic.internal.TupleGeneric
class ProductExample extends MonocleSuite {
case class Example(i : Int, s: String, b: Boolean)
implicit val gen = TupleGeneric[Example]
test("productToTuple creates an Iso between a Product and a Tuple") {
productToTuple.get(Example(1, "Hello", true)) shouldEqual ((1, "Hello", true))
productToTuple.reverseGet((1, "Hello", true)) shouldEqual Example(1, "Hello", true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment