Class

com.github.plokhotnyuk.fsi

FastStringInterpolator

Related Doc: package fsi

Permalink

implicit final class FastStringInterpolator extends AnyVal

Implicit class that introduces fs and fraw string interpolators which are high-performance 100% compatible drop-in replacement of simple & raw string interpolators (s"" or raw"" literals).

Here's an example of usage:

val host = "company.com"
val path = "blog"
println(fs"http://$host/$path")
println(fraw"http://$host/$path")

It will print 2 strings:

http://company.com/blog
http://company.com/blog

Let we have defined functions: def f(): Int and def g(): Double, then in compile-time for fs"a${f()}bb${g()}" the following code will be generated:

{
  val fresh$macro$1: Int = f();
  val fresh$macro$2: Double = g();
  com.github.plokhotnyuk.fsi.`package`.stringBuilder().append('a').append(fresh$macro$1).append("bb").append(fresh$macro$2).toString()
}: String
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FastStringInterpolator
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FastStringInterpolator(sc: StringContext)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. macro def fraw(args: Any*): String

    Permalink

    A fast version of the raw string interpolator.

    A fast version of the raw string interpolator.

    It inserts its arguments between corresponding parts of the string context. As opposed to the fs string interpolator, this one does not treat standard escape sequences as defined in the Scala specification.

  6. macro def fs(args: Any*): String

    Permalink

    A fast version of the simple string interpolator (s"" literal).

    A fast version of the simple string interpolator (s"" literal).

    It inserts its arguments between corresponding parts of the string context. It also treats standard escape sequences as defined in the Scala specification.

    If a parts string contains a backslash (\) character that does not start a valid escape sequence, then compilation error will be reported.

  7. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  9. val sc: StringContext

    Permalink
  10. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped