Skip to content

Instantly share code, notes, and snippets.

@markhibberd
Created February 14, 2013 22:29
Show Gist options
  • Select an option

  • Save markhibberd/4957015 to your computer and use it in GitHub Desktop.

Select an option

Save markhibberd/4957015 to your computer and use it in GitHub Desktop.
Argonaut json building combinators.
scala> ("asd" := 1)
res10: (String, argonaut.Json) = (asd,"1")
scala> ("qwe" :=? Some(1))
res11: Option[(String, argonaut.Json)] = Some((qwe,"1"))
scala> res10 ->: res11 ->?: jEmptyObject
res12: argonaut.Json = {"asd":"1","qwe":"1"}
scala> ("zxc" := "value") ->: ("nothing" :=? none[String]) ->?: jEmptyObject
res13: argonaut.Json = {"zxc":"value"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment