Skip to content

Instantly share code, notes, and snippets.

@rboyd
Created February 1, 2010 11:06
Show Gist options
  • Save rboyd/291602 to your computer and use it in GitHub Desktop.
Save rboyd/291602 to your computer and use it in GitHub Desktop.
scala> <foo thing={bar.map(el => Seq(Text(el)))} />
res9: scala.xml.Elem = <foo thing="bar"></foo>
scala> <foo thing={baz.map(el => Seq(Text(el)))} />
res10: scala.xml.Elem = <foo ></foo>
scala> bar
res11: Some[java.lang.String] = Some(bar)
scala> baz
res12: None.type = None
// thanks to dcsobral from #scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment