diff --git a/exercises/concept/dna-encoding/.meta/example.gleam b/exercises/concept/dna-encoding/.meta/example.gleam index 36afd8814..26b4f1df9 100644 --- a/exercises/concept/dna-encoding/.meta/example.gleam +++ b/exercises/concept/dna-encoding/.meta/example.gleam @@ -34,7 +34,7 @@ fn do_encode(dna: List(Nucleotide), acc: BitString) -> BitString { case dna { [] -> acc [nucleotide, ..rest] -> - do_encode(rest, <>) + do_encode(rest, <>) } } @@ -48,10 +48,10 @@ fn do_decode( ) -> Result(List(Nucleotide), Nil) { case dna { <<>> -> Ok(list.reverse(acc)) - <<0b00:2, rest:bit_string>> -> do_decode(rest, [Adenine, ..acc]) - <<0b01:2, rest:bit_string>> -> do_decode(rest, [Cytosine, ..acc]) - <<0b10:2, rest:bit_string>> -> do_decode(rest, [Guanine, ..acc]) - <<0b11:2, rest:bit_string>> -> do_decode(rest, [Thymine, ..acc]) + <<0b00:2, rest:bits>> -> do_decode(rest, [Adenine, ..acc]) + <<0b01:2, rest:bits>> -> do_decode(rest, [Cytosine, ..acc]) + <<0b10:2, rest:bits>> -> do_decode(rest, [Guanine, ..acc]) + <<0b11:2, rest:bits>> -> do_decode(rest, [Thymine, ..acc]) _ -> Error(Nil) } } diff --git a/exercises/practice/variable-length-quantity/.meta/example.gleam b/exercises/practice/variable-length-quantity/.meta/example.gleam index 50ef29433..8959ed5da 100644 --- a/exercises/practice/variable-length-quantity/.meta/example.gleam +++ b/exercises/practice/variable-length-quantity/.meta/example.gleam @@ -36,9 +36,8 @@ fn do_decode(string: BitString, acc: Int) -> Result(List(Int), Error) { case string { <<>> -> Ok([]) <<1:1, _:7>> -> Error(IncompleteSequence) - <<1:1, large_bits:7, rest:bit_string>> -> - do_decode(rest, 128 * acc + large_bits) - <<0:1, last_bits:7, rest:bit_string>> -> { + <<1:1, large_bits:7, rest:bits>> -> do_decode(rest, 128 * acc + large_bits) + <<0:1, last_bits:7, rest:bits>> -> { use integers <- result.then(do_decode(rest, 0)) Ok([128 * acc + last_bits, ..integers]) }