Created
June 5, 2019 13:00
-
-
Save lilac/2fa30a61f9b77f08aab7df1c0ac18b22 to your computer and use it in GitHub Desktop.
Json type in Dotty
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
case class Obj(val elems: (String, json)*) derives Eql | |
case class Arr(val elems: json*) | |
type json = Number | String | Obj | Arr | |
val s: json = Obj("a" -> 3, "b" -> "cd", "ar" -> Arr(1, "abc")) | |
println(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment