This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import rapture.json._ | |
| import rapture.json._ | |
| scala> import jsonBackends.jawn._ | |
| import jsonBackends.jawn._ // This also works with Play, Spray, Argonaut, JSON4S and Lift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import rapture.json._ | |
| import rapture.json._ | |
| scala> import jsonBackends.spray._ | |
| import jsonBackends.spray._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import rapture.json._ | |
| import rapture.json._ | |
| scala> import jsonBackends.jawn._ | |
| import jsonBackends.jawn._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import rapture.xml._ | |
| import rapture.xml._ | |
| scala> import xmlBackends.stdlib._ | |
| import xmlBackends.stdlib._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scala> :paste | |
| // Entering paste mode (ctrl-D to finish) | |
| val fn = tmatch( | |
| when[Int] { i => i + 1 } | |
| when[String] { s => s.toInt } | |
| when[Symbol] { s => 3.1415926 } | |
| when[Double] { d => "You entered a double" } | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala 2.12.0-M5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions for evaluation. Or try :help. | |
| scala> case class Foo(x: Int) | |
| defined class Foo | |
| scala> implicit def foo: Foo = Foo(1) | |
| foo: Foo | |
| scala> implicitly[Foo] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Welcome to Scala 2.12.0-M5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
| Type in expressions for evaluation. Or try :help. | |
| scala> case class Foo(x: Int) | |
| defined class Foo | |
| scala> object Bar { | |
| | implicit val foo: Foo = Foo(1) | |
| | object Baz { | |
| | implicit val foo: Foo = Foo(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| magnolia/one: | |
| 00:01.388187 src/foo.scala | |
| 00:04.130835 src/magnolia/one.scala | |
| 00:01.339720 src/magnolia/one.scala | |
| 00:00.893572 src/magnolia/one.scala | |
| 00:00.640120 src/magnolia/one.scala | |
| 00:00.664193 src/magnolia/one.scala | |
| 00:00.608714 src/magnolia/one.scala | |
| 00:00.502048 src/magnolia/one.scala | |
| 00:00.497764 src/magnolia/one.scala |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Keybase proof | |
| I hereby claim: | |
| * I am propensive on github. | |
| * I am propensive (https://keybase.io/propensive) on keybase. | |
| * I have a public key ASArWRtQnt8y3AuDBYD0B3FsCtq6W4pRE0tAl6GhlZMAcAo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import magnolia.{CaseClass, Magnolia, SealedTrait} | |
| import org.specs2.matcher.describe._ | |
| import scala.language.experimental.macros | |
| object DiffableDerivation { | |
| /** binds the Magnolia macro to this derivation object */ | |
| implicit def genDiffable[T]: Diffable[T] = macro Magnolia.gen[T] |