4.6.2 Tuples
TBoS p.214, SD
Shen supports tuples; the function '(@p a b)' returns the pair of a and b. @p
is polyadic and associates to the right; '(@p a b c)' is shorthand for '(@p a (@p b c))'.
'fst' and 'snd' select the first and second elements of a pair. The function 'tuple?' recognises
all and only tuples.
(0-) (@p (+ 1 1) a)
(@p 2 a)
(1-) (fst (@p a b))
a
(2-) (snd (@p a b))
b |
|