aboutsummaryrefslogtreecommitdiff
path: root/src/tuple.gleam
blob: d437a9fed8ab0c343ea501dd375cbb5237faf7da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import expect

pub fn first(tup) {
  let {a, _} = tup
  a
}

test first {
  {1, 2}
  |> first
  |> expect:equal(_, 1)
}

pub fn second(tup) {
  let {_, a} = tup
  a
}

test second {
  {1, 2}
  |> second
  |> expect:equal(_, 2)
}