aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/samplecode/gleam/out.gleam
blob: 0e54b5047fb7272f465ddfcff302e8aaa1e03964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn encode_(dna: List(Nucleotide), acc: BitArray) {
  case dna {
    [] -> acc
    [first, ..rest] -> {
      let nbit = encode_nucleotide(first)
      encode_(rest, <<acc:bits, nbit:size(2)>>)
    }
  }
}

pub fn encode(dna: List(Nucleotide)) -> BitArray {
  encode_(dna, <<>>)
}