diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-03 17:37:03 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-09-03 17:37:03 +0200 |
commit | 123c8bc693063cfc880709c7dfa700a177a66adb (patch) | |
tree | 5dd508c4ac5876fe80a661a4281b6fdaf3d064a9 /src/lib/sounds/sounds.ml | |
parent | 48dc04c3b9afe19207d15b873452129d9c2b3b4c (diff) |
Ended refactoring
Diffstat (limited to 'src/lib/sounds/sounds.ml')
-rw-r--r-- | src/lib/sounds/sounds.ml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/sounds/sounds.ml b/src/lib/sounds/sounds.ml index 92a644f..e5f5d29 100644 --- a/src/lib/sounds/sounds.ml +++ b/src/lib/sounds/sounds.ml @@ -1,4 +1,5 @@ module Sig = Sig +module Repr = Repr type kind = | None @@ -239,14 +240,15 @@ let muted f = code = Muted f } let rec repr - : t -> Repr.t - = fun letter -> + : type a. (module Sig.REPR with type t = a) -> t -> a + = fun m letter -> + let module Repr = (val m:Sig.REPR with type t = a) in match letter.code, letter.nasal with - | None, _ -> "" + | None, _ -> Repr.none | Voyel_A, false -> Repr.a | Voyel_A, true -> Repr.a_nasal - | Voyel_AI, false -> "E" + | Voyel_AI, false -> Repr.e_opened | Voyel_AI, true -> Repr.i_nasal | E_Closed, _ -> Repr.e_closed | E_Opened, true | Voyel_E, true -> Repr.a_nasal @@ -283,5 +285,5 @@ let rec repr | Consonant_N, _ -> Repr.n | Consonant_L, _ -> Repr.l | Consonant_R, _ -> Repr.r - | Diphtonge (l1, l2), _ -> Repr.diphtongue (repr l1) (repr l2) - | Muted t, _ -> Repr.muted (repr t) + | Diphtonge (l1, l2), _ -> Repr.diphtongue (repr m l1) (repr m l2) + | Muted t, _ -> Repr.muted (repr m t) |