Skip to content

Commit

Permalink
Avoid redefining rle type in modified run-length exercice (ocaml#476)
Browse files Browse the repository at this point in the history
Co-authored-by: Thibaut Mattio <thibaut.mattio@gmail.com>
  • Loading branch information
fccm and tmattio committed Jun 8, 2022
1 parent 3148148 commit 91804e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/problems/011_modified_run_length.md
Expand Up @@ -35,6 +35,7 @@ elements with duplicates are transferred as (N E) lists.
Since OCaml lists are homogeneous, one needs to define a type to hold
both single elements and sub-lists.

<!-- $MDX skip -->
```ocaml
type 'a rle =
| One of 'a
Expand All @@ -43,7 +44,7 @@ type 'a rle =

```ocaml
# encode ["a"; "a"; "a"; "a"; "b"; "c"; "c"; "a"; "a"; "d"; "e"; "e"; "e"; "e"];;
- : string rle/2 list =
- : string rle list =
[Many (4, "a"); One "b"; Many (2, "c"); Many (2, "a"); One "d";
Many (4, "e")]
```

0 comments on commit 91804e9

Please sign in to comment.