final case class Yield[Element](element: Element) extends AnyVal with Keyword[Yield[Element], Unit] with Product with Serializable
Author:
杨博 (Yang Bo)
- Source
- Yield.scala
This
Yield
keyword must be put inside a function that returnsSeq[Element]
orSeq[Element] !! ...
, or it will not compile."def f(): Int = !Yield(1)" shouldNot compile
, 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"))
- See also
comprehension if you want to use traditional
for
comprehension instead of !-notation.
- Alphabetic
- By Inheritance
- Yield
- Serializable
- Serializable
- Product
- Equals
- Keyword
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Yield(element: Element)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
- def +(other: String): String
- def ->[B](y: B): (Yield[Element], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
apply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Element], Domain, Unit]): Domain
An alias to cpsApply.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
cpsApply[Domain](handler: (Unit) ⇒ Domain)(implicit dsl: Dsl[Yield[Element], Domain, Unit]): Domain
- Definition Classes
- Keyword
- Annotations
- @inline()
- val element: Element
- def ensuring(cond: (Yield[Element]) ⇒ Boolean, msg: ⇒ Any): Yield[Element]
- def ensuring(cond: (Yield[Element]) ⇒ Boolean): Yield[Element]
- def ensuring(cond: Boolean, msg: ⇒ Any): Yield[Element]
- def ensuring(cond: Boolean): Yield[Element]
- def formatted(fmtstr: String): String
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def unary_!: Unit
- def →[B](y: B): (Yield[Element], B)