summaryrefslogtreecommitdiff
path: root/src/lib/modifiers/nasal.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-09-03 17:37:03 +0200
committerSébastien Dailly <sebastien@chimrod.com>2021-09-03 17:37:03 +0200
commit123c8bc693063cfc880709c7dfa700a177a66adb (patch)
tree5dd508c4ac5876fe80a661a4281b6fdaf3d064a9 /src/lib/modifiers/nasal.ml
parent48dc04c3b9afe19207d15b873452129d9c2b3b4c (diff)
Ended refactoring
Diffstat (limited to 'src/lib/modifiers/nasal.ml')
-rw-r--r--src/lib/modifiers/nasal.ml11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/modifiers/nasal.ml b/src/lib/modifiers/nasal.ml
index ec8ddb4..57a3235 100644
--- a/src/lib/modifiers/nasal.ml
+++ b/src/lib/modifiers/nasal.ml
@@ -1,9 +1,9 @@
+module T = Sounds
(* Remove the ending consonant, and transform the voyel into
the nasal form *)
let transform
- : (module Sounds.Sig.T with type t = 'a) -> 'a Sig.consonants option -> 'a Sig.t -> 'a Sig.t
- = fun (type el) m c init ->
- let module T = (val m:Sounds.Sig.T with type t = el) in
+ : Sounds.t Sig.consonants option -> Sounds.t Sig.t -> Sounds.t Sig.t
+ = fun c init ->
let (((v1, v2), _) , _) = init in
begin match T.nasal v1, T.nasal v2 with
@@ -21,15 +21,14 @@ let transform
merge from two distinct elements ? *)
let process
: 'a Sig.modifier
- = fun (type el) m init ->
- let module T = (val m:Sounds.Sig.T with type t = el) in
+ = fun init ->
let (((v1, v2), c) , ending) = init in
let ending = Option.bind ending (fun x -> x) in
let opening = Option.map (fun v -> v.Sig.opening) c in
let is_voyel = T.is_voyel v1 && T.is_voyel v2 in
match ending, is_voyel, opening with
| Some ending, _, _ when T.is_nasal ending ->
- transform m c init
+ transform c init
| None, false, Some (opening::tl) when T.is_nasal opening ->
(* If there is no voyel here, transform the opening consonant as an
ending consonant for the next syllabus *)