Skip to content

Instantly share code, notes, and snippets.

@tanishiking
Created June 26, 2024 03:29
Show Gist options
  • Save tanishiking/535bdee335bd5e13e84dbf5f425ba818 to your computer and use it in GitHub Desktop.
Save tanishiking/535bdee335bd5e13e84dbf5f425ba818 to your computer and use it in GitHub Desktop.
amm-intellij-example

amm-intellij-example

Screenshot 2023-04-21 at 17 22 49

Screenshot 2023-04-21 at 17 20 36

Not sure why ivy imports are marked red, but everything works fine 👍

import $ivy.`io.circe::circe-core:0.14.5`
import $ivy.`io.circe::circe-parser:0.14.5`
import $ivy.`io.circe::circe-generic:0.14.5`
import io.circe._, io.circe.generic.auto._, io.circe.parser._, io.circe.syntax._
sealed trait Foo
case class Bar(xs: Vector[String]) extends Foo
case class Qux(i: Int, d: Option[Double]) extends Foo
@main
def main(thing: String = "World"): Unit = {
val foo: Foo = Qux(13, Some(14.0))
val json = foo.asJson.noSpaces
pprint.pprintln(json)
val decodedFoo = decode[Foo](json)
pprint.pprintln(decodedFoo)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment