Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thoughtworksinc/q.scala

Convert any value to code
https://github.com/thoughtworksinc/q.scala

scala

Last synced: about 2 months ago
JSON representation

Convert any value to code

Awesome Lists containing this project

README

        

# Q.scala

[![Build Status](https://travis-ci.org/ThoughtWorksInc/Q.scala.svg?branch=master)](https://travis-ci.org/ThoughtWorksInc/Q.scala)
[![Latest version](https://index.scala-lang.org/thoughtworksinc/q.scala/q/latest.svg)](https://index.scala-lang.org/thoughtworksinc/q.scala/q)
[![Scaladoc](https://javadoc.io/badge/com.thoughtworks.q/q_2.11.svg?label=scaladoc)](https://javadoc.io/page/com.thoughtworks.q/q_2.11/latest/com/thoughtworks/Q$.html)

**Q.scala** is a library to convert any value to parsable code.

## Usage

``` sbt
libraryDependencies += "com.thoughtworks.q" %% "q" % "latest.release"
```

``` scala
import com.thoughtworks.Q._
import scala.reflect.runtime.universe._

val data: Seq[Either[Double, String]] = Seq(Left(math.random), Right("string data"))

// Output: _root_.scala.Seq(_root_.scala.util.Left(0.6437966035784641), _root_.scala.util.Right("string data"))
println(q"$data")
```