No matching definitions.

tur/tuple

stdlib/tuple.tur

typed N-ary tuples (Tuple2..Tuple8).

Since: Phase TP1 (Tuple2); Phase TP2 (Tuple3..Tuple5); Phase TP3 (Tuple6..Tuple8)

defstruct

Tuple2

(defstruct Tuple2 [A B])

two-element tuple with element types A, B.

Since: Phase TP1

defn

tuple2

(tuple2 [A B])

construct a Tuple2[A B].

afirst element (type A)
bsecond element (type B)

A Tuple2[A B] value.

(tuple2 1 "hi")  ; => Tuple2(1, "hi")

Since: Phase TP1

defn

tuple2-1st

(tuple2-1st [A B])

first element of a Tuple2[A B].

tTuple2[A B]

The first element of type A.

(tuple2-1st (tuple2 10 20))  ; => 10

Since: Phase TP1

defn

tuple2-2nd

(tuple2-2nd [A B])

second element of a Tuple2[A B].

tTuple2[A B]

The second element of type B.

(tuple2-2nd (tuple2 10 20))  ; => 20

Since: Phase TP1

defstruct

Tuple3

(defstruct Tuple3 [A B C])

three-element tuple with element types A, B, C.

Since: Phase TP2

defn

tuple3

(tuple3 [A B C])

construct a Tuple3[A B C].

afirst element (type A)
bsecond element (type B)
cthird element (type C)

A Tuple3[A B C] value.

(tuple3 1 "hi" 3.14)  ; => Tuple3(1, "hi", 3.14)

Since: Phase TP2

defn

tuple3-1st

(tuple3-1st [A B C])

first element of a Tuple3[A B C].

Since: Phase TP2

defn

tuple3-2nd

(tuple3-2nd [A B C])

second element of a Tuple3[A B C].

Since: Phase TP2

defn

tuple3-3rd

(tuple3-3rd [A B C])

third element of a Tuple3[A B C].

Since: Phase TP2

defstruct

Tuple4

(defstruct Tuple4 [A B C D])

four-element tuple with element types A, B, C, D.

Since: Phase TP2

defn

tuple4

(tuple4 [A B C D])

construct a Tuple4[A B C D].

afirst element (type A)
bsecond element (type B)
cthird element (type C)
dfourth element (type D)

A Tuple4[A B C D] value.

(tuple4 1 "hi" 3.14 #t)  ; => Tuple4(1, "hi", 3.14, #t)

Since: Phase TP2

defn

tuple4-1st

(tuple4-1st [A B C D])

first element of a Tuple4[A B C D].

Since: Phase TP2

defn

tuple4-2nd

(tuple4-2nd [A B C D])

second element of a Tuple4[A B C D].

Since: Phase TP2

defn

tuple4-3rd

(tuple4-3rd [A B C D])

third element of a Tuple4[A B C D].

Since: Phase TP2

defn

tuple4-4th

(tuple4-4th [A B C D])

fourth element of a Tuple4[A B C D].

Since: Phase TP2

defstruct

Tuple5

(defstruct Tuple5 [A B C D E])

five-element tuple with element types A, B, C, D, E.

Since: Phase TP2

defn

tuple5

(tuple5 [A B C D E])

construct a Tuple5[A B C D E].

afirst element (type A)
bsecond element (type B)
cthird element (type C)
dfourth element (type D)
efifth element (type E)

A Tuple5[A B C D E] value.

(tuple5 1 "hi" 3.14 #t :ok)  ; => Tuple5(1, "hi", 3.14, #t, :ok)

Since: Phase TP2

defn

tuple5-1st

(tuple5-1st [A B C D E])

first element of a Tuple5[A B C D E].

Since: Phase TP2

defn

tuple5-2nd

(tuple5-2nd [A B C D E])

second element of a Tuple5[A B C D E].

Since: Phase TP2

defn

tuple5-3rd

(tuple5-3rd [A B C D E])

third element of a Tuple5[A B C D E].

Since: Phase TP2

defn

tuple5-4th

(tuple5-4th [A B C D E])

fourth element of a Tuple5[A B C D E].

Since: Phase TP2

defn

tuple5-5th

(tuple5-5th [A B C D E])

fifth element of a Tuple5[A B C D E].

Since: Phase TP2

defstruct

Tuple6

(defstruct Tuple6 [A B C D E F])

six-element tuple with element types A, B, C, D, E, F.

Since: Phase TP3

defn

tuple6

(tuple6 [A B C D E F])

construct a Tuple6[A B C D E F].

afirst element (type A)
bsecond element (type B)
cthird element (type C)
dfourth element (type D)
efifth element (type E)
fsixth element (type F)

A Tuple6[A B C D E F] value.

(tuple6 1 "hi" 3.14 #t :ok 99)  ; => Tuple6(1, "hi", 3.14, #t, :ok, 99)

Since: Phase TP3

defn

tuple6-1st

(tuple6-1st [A B C D E F])

first element of a Tuple6[A B C D E F].

Since: Phase TP3

defn

tuple6-2nd

(tuple6-2nd [A B C D E F])

second element of a Tuple6[A B C D E F].

Since: Phase TP3

defn

tuple6-3rd

(tuple6-3rd [A B C D E F])

third element of a Tuple6[A B C D E F].

Since: Phase TP3

defn

tuple6-4th

(tuple6-4th [A B C D E F])

fourth element of a Tuple6[A B C D E F].

Since: Phase TP3

defn

tuple6-5th

(tuple6-5th [A B C D E F])

fifth element of a Tuple6[A B C D E F].

Since: Phase TP3

defn

tuple6-6th

(tuple6-6th [A B C D E F])

sixth element of a Tuple6[A B C D E F].

Since: Phase TP3

defstruct

Tuple7

(defstruct Tuple7 [])

seven-element tuple with element types A, B, C, D, E, F, G.

Since: Phase TP3

defn

tuple7

(tuple7 [A B C D E F G])

construct a Tuple7[A B C D E F G].

afirst element (type A)
bsecond element (type B)
cthird element (type C)
dfourth element (type D)
efifth element (type E)
fsixth element (type F)
gseventh element (type G)

A Tuple7[A B C D E F G] value.

(tuple7 1 2 3 4 5 6 7)  ; => Tuple7(1, 2, 3, 4, 5, 6, 7)

Since: Phase TP3

defn

tuple7-1st

(tuple7-1st [A B C D E F G])

first element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-2nd

(tuple7-2nd [A B C D E F G])

second element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-3rd

(tuple7-3rd [A B C D E F G])

third element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-4th

(tuple7-4th [A B C D E F G])

fourth element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-5th

(tuple7-5th [A B C D E F G])

fifth element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-6th

(tuple7-6th [A B C D E F G])

sixth element of a Tuple7[A B C D E F G].

Since: Phase TP3

defn

tuple7-7th

(tuple7-7th [A B C D E F G])

seventh element of a Tuple7[A B C D E F G].

Since: Phase TP3

defstruct

Tuple8

(defstruct Tuple8 [])

eight-element tuple with element types A, B, C, D, E, F, G, H.

Since: Phase TP3

defn

tuple8

(tuple8 [A B C D E F G H])

construct a Tuple8[A B C D E F G H].

afirst element (type A)
bsecond element (type B)
cthird element (type C)
dfourth element (type D)
efifth element (type E)
fsixth element (type F)
gseventh element (type G)
heighth element (type H)

A Tuple8[A B C D E F G H] value.

(tuple8 1 2 3 4 5 6 7 8)  ; => Tuple8(1, 2, 3, 4, 5, 6, 7, 8)

Since: Phase TP3

defn

tuple8-1st

(tuple8-1st [A B C D E F G H])

first element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-2nd

(tuple8-2nd [A B C D E F G H])

second element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-3rd

(tuple8-3rd [A B C D E F G H])

third element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-4th

(tuple8-4th [A B C D E F G H])

fourth element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-5th

(tuple8-5th [A B C D E F G H])

fifth element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-6th

(tuple8-6th [A B C D E F G H])

sixth element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-7th

(tuple8-7th [A B C D E F G H])

seventh element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defn

tuple8-8th

(tuple8-8th [A B C D E F G H])

eighth element of a Tuple8[A B C D E F G H].

Since: Phase TP3

defmacro

tuple2-eq?

(tuple2-eq? [t1 t2 e1-cmp e2-cmp])

compare two Tuple2 values element-wise using supplied

t1first Tuple2[A B]
t2second Tuple2[A B]
e1-cmpcomparator for the first element (fn [a b] :bool)
e2-cmpcomparator for the second element (fn [a b] :bool)

true if both elements are equal under their comparators.

(tuple2-eq? (tuple2 1 2) (tuple2 1 2)
              (fn [a b] (= a b)) (fn [a b] (= a b)))  ; => true

Since: Phase TP2

defn

tuple2-eq-carrier?

(tuple2-eq-carrier? [t1 : int t2 : int e1-cmp e2-cmp])

legacy carrier-ABI helper used inside Tuple2's Eq

Since: Phase TP2

definstance

Eq[Tuple2]

(definstance Eq [Tuple2])