Object

com.eharmony.aloha.semantics.func

GenFunc

Related Doc: package func

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

    Permalink

    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.

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

    Permalink

    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.

  10. 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]

    Permalink
  11. 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]

    Permalink
  12. 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]

    Permalink
  13. 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]

    Permalink
  14. 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]

    Permalink
  15. 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]

    Permalink
  16. 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]

    Permalink
  17. 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]

    Permalink
  18. 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]

    Permalink
  19. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  23. val maxArity: Int

    Permalink
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped