Packages

trait Tupler[A, B] extends AnyRef

Defines a strategy for tupling A and B values, according to types A and B.

The actual implementation avoids nested tuples and eliminates Unit, so that instead of ending with, e.g., the following type:

((Unit, Int), (((Unit, Unit), String)))

We just get:

(Int, String)

The following rules are implemented (by increasing priority):

  • A, B -> (A, B)
  • A, (B, C) -> (A, B, C)
  • (A, B), C -> (A, B, C)
  • A, (B, C, D) -> (A, B, C, D)
  • (A, B), (C, D) -> (A, B, C, D)
  • A, (B, C, D, E) -> (A, B, C, D, E)
  • (A, B), (C, D, E) -> (A, B, C, D, E)
  • (A, B, C), D -> (A, B, C, D)
  • (A, B, C, D), E -> (A, B, C, D, E)
  • (A, B, C, D, E), F -> (A, B, C, D, E, F)
  • A, Unit -> A
  • Unit, A -> A
Source
Tupler.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tupler
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract type Out

Abstract Value Members

  1. abstract def apply(a: A, b: B): Out
  2. abstract def unapply(out: Out): (A, B)