Items1Named

libretto.lambda.Items1Named
object Items1Named

Data types for working with non-empty heterogeneous lists of named items of the form

"name1" :: T1 || ... || "nameN" :: Tn

where || is the separator of items (associates to the left) and :: represents a type annotation.

Analogous to Items1, except for named items.

Unlike Items1, no special "Nil" type (list terminator) is needed, as there is no ambiguity:

  • "x" :: (A || B) is unambiguously a single-item list;
  • "x" :: A || "y" :: B is unambiguously a two-item list.

whereas in unnamed version without Nil terminator, both cases above would reduce A || B. (NB: With Nil terminator, they reduce to two distinct types. Nil || (A || B) and (Nil || A) || B, respectively.)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object Member

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Member.type
sealed trait Member[||[_, _], ::[_, _], Label, A, Cases]

Witnesses that Label :: A is one of Cases, where Cases is of the form (lbl1 :: A1) || (lbl2 :: A2) || ... (where || associates to the left).

Witnesses that Label :: A is one of Cases, where Cases is of the form (lbl1 :: A1) || (lbl2 :: A2) || ... (where || associates to the left).

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class InInit[||, ::, Label, A, Init, BLbl, B]
class InLast[||, ::, Init, Label, A]
class Single[||, ::, Label, A]
object OneOf

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
OneOf.type
sealed trait OneOf[||[_, _], ::[_, _], F[_, _], Cases]

Holds F[K, V] for K :: V one of Cases, where Cases is of the form (K1 :: V1) || (K2 :: V2) || ... (where || associates to the left).

Holds F[K, V] for K :: V one of Cases, where Cases is of the form (K1 :: V1) || (K2 :: V2) || ... (where || associates to the left).

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Aux[||, ::, F, Cases, K, V]
class InInit[||, ::, F, Ki, Vi, Init, Kn, Vn]
class Last[||, ::, F, Init, K, V]
class Single[||, ::, F, K, V]
object Product

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Product.type
sealed trait Product[||[_, _], ::[_, _], F[_], Items]

A data type that holds all items of the Items`` list, each wrapped inF[_]`.

A data type that holds all items of the Items`` list, each wrapped inF[_]`.

In other words, an n-ary tuple of named values F[Ai], where Items = "name1" :: A1 || ... || "nameN" :: An, where || associates to the left.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Single[||, ::, F, Lbl, A]
class Snoc[||, ::, F, Init, Lbl, A]
object Sum

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Sum.type
sealed trait Sum[||[_, _], ::[_, _], F[_], Items]

A data type that holds one items of the Items`` list, wrapped inF[_]`.

A data type that holds one items of the Items`` list, wrapped inF[_]`.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Value[||, ::, F, Lbl, A, Items]
object Witness

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Witness.type
sealed trait Witness[||[_, _], ::[_, _], Items]

Witnesses that Items is a list of name :: type pairs, i.e. that Items is of the form (Name1 :: T1) || ... || (NameN :: TN).

Witnesses that Items is a list of name :: type pairs, i.e. that Items is of the form (Name1 :: T1) || ... || (NameN :: TN).

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Single[||, ::, Lbl, A]
class Snoc[||, ::, Init, Lbl, A]