Ask

com.softinio.verdict4s.Ask
See theAsk companion class
object Ask

Building an Ask from one to twelve questions, and the type that computes its answers.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Ask.type

Members list

Type members

Types

type Answers[Q <: Tuple] = InverseMap[Q, Question]

The positionally exact answer tuple for a tuple of questions.

The positionally exact answer tuple for a tuple of questions.

Tuple.InverseMap is what does the work: given (Question[A], Question[B]) it reduces to (A, B). It only reduces because every Question.* constructor returns the opaque Question[X] itself, uniformly and with an explicit return type.

Attributes

Value members

Concrete methods

def apply[Q <: Tuple](questions: Q)(using IsMappedBy[Question][Q]): Ask[Q]

Ask several questions together.

Ask several questions together.

Ask(urgency, team, frustration) // or Ask((urgency, team, frustration))

One method rather than an overload per arity: Scala tuples the arguments for you. It does not clash with the single-question overload below, whose erased signature differs by the evidence parameter.

IsMappedBy is what rejects a tuple holding something that is not a question.

Attributes

def apply[A](question: Question[A]): Ask[Question[A] *: EmptyTuple]

Ask a single question.

Ask a single question.

Needed separately because one argument cannot be tupled into a 1-tuple.

Attributes

def defaultKey(index: Int): String

Positional question keys.

Positional question keys.

Zero padded so that lexicographic order matches positional order, which keeps the encoded request readable and its golden tests stable. Padded by hand rather than with f"q$i%02d", because Scala.js implements java.util.Formatter only partially.

Attributes