com.eharmony.aloha.semantics.func

GenFunc

object GenFunc

Provides a series of functions that create instances of GenFuncN. These are preferable to calling the class constructors directly because we can completely avoid specifying typing information do to the multiple argument lists in the functions. This helps especially when generating code via multi-stage programming.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GenFunc
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def f0[A, B](specification: String, f: (A) ⇒ B): GenFunc0[A, B]

    Create a function that doesn't compute any intermediate values from A while producing a value of type B.

    Create a function that doesn't compute any intermediate values from A while producing a value of type B.

    A

    input type to the resulting function

    B

    output type of the resulting function

    specification

    string specification of the function.

    f

    a function taking no variables and returns a value of type C

    returns

    a function F = f(x). Essentially a delegate that delegates to f. This mainly means that the definer of f needs to either make f invariant to an input of A or needs to have inside knowledge of A.

  11. def f1[A, B1, C](f1: GeneratedAccessor[A, B1])(specification: String, f: (B1) ⇒ C): GenFunc1[A, B1, C]

    Create a function in one variable that takes an instance of A and returns a value of type C.

    Create a function in one variable that takes an instance of A and returns a value of type C. Note that this function like the other functions in GenFunc are provided to assist type resolution. When generating code, it's really nice not to have to specify the type of the variables because we can just let the type resolution mechanism in Scala take care of it.

    // Get the value associated with the "one" key in the map and add 1 to it.
    val f1 =
      GenFunc.f1(
        GeneratedAccessor(
          "one",                                      // The descriptor of the variable.
          (_:Map[String, Int]) get "one",             // The actual implementation.
          Some("""(_:Map[String, Int]) get "one"""")  // Optional String description of extractor.
        )
      )(
        "${one} + 1",    // Description of function.
        _.map(_ + 1)     // No typing information necessary.
      )
    
      f1(Map("one" -> 1))               // Some(2)
      f1.accessorOutputMissing(Map())   // List("one")  The list of missing fields (variables) required by f1.
    A

    input type to the resulting function

    B1

    the type of the variable used in the function

    C

    output type of the resulting function

    f1

    A function that pulls a variables value out of the input type.

    specification

    string specification of the function.

    f

    a function taking one variable (the value returned by f1) that returns type C

    returns

    a function F = f(f1(x)) in one variable that extracts x's value with accessor function f1.

  12. def f10[A, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5], f6: GeneratedAccessor[A, B6], f7: GeneratedAccessor[A, B7], f8: GeneratedAccessor[A, B8], f9: GeneratedAccessor[A, B9], f10: GeneratedAccessor[A, B10])(specification: String, f: (B1, B2, B3, B4, B5, B6, B7, B8, B9, B10) ⇒ C): GenFunc10[A, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, C]

  13. def f2[A, B1, B2, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2])(specification: String, f: (B1, B2) ⇒ C): GenFunc2[A, B1, B2, C]

  14. def f3[A, B1, B2, B3, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3])(specification: String, f: (B1, B2, B3) ⇒ C): GenFunc3[A, B1, B2, B3, C]

  15. def f4[A, B1, B2, B3, B4, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4])(specification: String, f: (B1, B2, B3, B4) ⇒ C): GenFunc4[A, B1, B2, B3, B4, C]

  16. def f5[A, B1, B2, B3, B4, B5, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5])(specification: String, f: (B1, B2, B3, B4, B5) ⇒ C): GenFunc5[A, B1, B2, B3, B4, B5, C]

  17. def f6[A, B1, B2, B3, B4, B5, B6, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5], f6: GeneratedAccessor[A, B6])(specification: String, f: (B1, B2, B3, B4, B5, B6) ⇒ C): GenFunc6[A, B1, B2, B3, B4, B5, B6, C]

  18. def f7[A, B1, B2, B3, B4, B5, B6, B7, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5], f6: GeneratedAccessor[A, B6], f7: GeneratedAccessor[A, B7])(specification: String, f: (B1, B2, B3, B4, B5, B6, B7) ⇒ C): GenFunc7[A, B1, B2, B3, B4, B5, B6, B7, C]

  19. def f8[A, B1, B2, B3, B4, B5, B6, B7, B8, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5], f6: GeneratedAccessor[A, B6], f7: GeneratedAccessor[A, B7], f8: GeneratedAccessor[A, B8])(specification: String, f: (B1, B2, B3, B4, B5, B6, B7, B8) ⇒ C): GenFunc8[A, B1, B2, B3, B4, B5, B6, B7, B8, C]

  20. def f9[A, B1, B2, B3, B4, B5, B6, B7, B8, B9, C](f1: GeneratedAccessor[A, B1], f2: GeneratedAccessor[A, B2], f3: GeneratedAccessor[A, B3], f4: GeneratedAccessor[A, B4], f5: GeneratedAccessor[A, B5], f6: GeneratedAccessor[A, B6], f7: GeneratedAccessor[A, B7], f8: GeneratedAccessor[A, B8], f9: GeneratedAccessor[A, B9])(specification: String, f: (B1, B2, B3, B4, B5, B6, B7, B8, B9) ⇒ C): GenFunc9[A, B1, B2, B3, B4, B5, B6, B7, B8, B9, C]

  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. val maxArity: Int

  26. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped