Class/Object

com.thoughtworks.dsl.keywords

Yield

Related Docs: object Yield | package keywords

Permalink

final case class Yield[Element](element: Element) extends AnyVal with Keyword[Yield[Element], Unit] with Product with Serializable

Author:

杨博 (Yang Bo)

Source
Yield.scala
Examples:
  1. Yield keywords can be used together with other keywords.

    def gccFlagBuilder(sourceFile: String, includes: String*): Stream[String] = {
      !Yield("gcc")
      !Yield("-c")
      !Yield(sourceFile)
      val include = !Each(includes)
      !Yield("-I")
      !Yield(include)
      !Continue
    }
    gccFlagBuilder("main.c", "lib1/include", "lib2/include") should be(Stream("gcc", "-c", "main.c", "-I", "lib1/include", "-I", "lib2/include"))
  2. ,
  3. This Yield keyword must be put inside a function that returns Seq[Element] or Seq[Element] !! ..., or it will not compile.

    "def f(): Int = !Yield(1)" shouldNot compile
See also

comprehension if you want to use traditional for comprehension instead of !-notation.

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Yield
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Keyword
  7. AnyVal
  8. Any
Implicitly
  1. by implicitYield
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Yield(element: Element)

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to any2stringadd[Yield[Element]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Yield[Element], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to ArrowAssoc[Yield[Element]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  6. final def apply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Element], Domain, Unit]): Domain

    Permalink

    An alias to cpsApply.

    An alias to cpsApply.

    Definition Classes
    Keyword
    Annotations
    @inline()
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. final def cpsApply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Element], Domain, Unit]): Domain

    Permalink
    Definition Classes
    Keyword
    Annotations
    @inline()
  9. val element: Element

    Permalink
  10. def ensuring(cond: (Yield[Element]) ⇒ Boolean, msg: ⇒ Any): Yield[Element]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Ensuring[Yield[Element]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (Yield[Element]) ⇒ Boolean): Yield[Element]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Ensuring[Yield[Element]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ Any): Yield[Element]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Ensuring[Yield[Element]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): Yield[Element]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Ensuring[Yield[Element]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to StringFormat[Yield[Element]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. def getClass(): Class[_ <: AnyVal]

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

    Permalink
    Definition Classes
    Any
  17. final def unary_!: Unit

    Permalink
    Definition Classes
    Keyword
    Annotations
    @shift() @compileTimeOnly( ... )
  18. def [B](y: B): (Yield[Element], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to ArrowAssoc[Yield[Element]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. final def apply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Yield[Element]], Domain, Unit]): Domain

    Permalink

    An alias to cpsApply.

    An alias to cpsApply.

    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Yield[Yield[Element]] performed by method implicitYield in com.thoughtworks.dsl.keywords.Yield.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (yield: Yield[Yield[Element]]).apply(handler)(dsl)
    Definition Classes
    Keyword
    Annotations
    @inline()
  2. final def cpsApply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Yield[Element]], Domain, Unit]): Domain

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Yield[Yield[Element]] performed by method implicitYield in com.thoughtworks.dsl.keywords.Yield.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (yield: Yield[Yield[Element]]).cpsApply(handler)(dsl)
    Definition Classes
    Keyword
    Annotations
    @inline()
  3. val element: Yield[Element]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Yield[Yield[Element]] performed by method implicitYield in com.thoughtworks.dsl.keywords.Yield.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (yield: Yield[Yield[Element]]).element
  4. final def unary_!: Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from Yield[Element] to Yield[Yield[Element]] performed by method implicitYield in com.thoughtworks.dsl.keywords.Yield.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (yield: Yield[Yield[Element]]).unary_!
    Definition Classes
    Keyword
    Annotations
    @shift() @compileTimeOnly( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Keyword[Yield[Element], Unit]

Inherited from AnyVal

Inherited from Any

Inherited by implicit conversion implicitYield from Yield[Element] to Yield[Yield[Element]]

Inherited by implicit conversion any2stringadd from Yield[Element] to any2stringadd[Yield[Element]]

Inherited by implicit conversion StringFormat from Yield[Element] to StringFormat[Yield[Element]]

Inherited by implicit conversion Ensuring from Yield[Element] to Ensuring[Yield[Element]]

Inherited by implicit conversion ArrowAssoc from Yield[Element] to ArrowAssoc[Yield[Element]]

Ungrouped