aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/samplecode/gleam/out.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'test/formatters/samplecode/gleam/out.gleam')
-rw-r--r--test/formatters/samplecode/gleam/out.gleam13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/formatters/samplecode/gleam/out.gleam b/test/formatters/samplecode/gleam/out.gleam
new file mode 100644
index 0000000..0e54b50
--- /dev/null
+++ b/test/formatters/samplecode/gleam/out.gleam
@@ -0,0 +1,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, <<>>)
+}