refactor Make muscles private to exercise

Keep the muscle vocabulary inside Exercise because no external caller needs its representation. Preserve the policy-level pre-exhaust relationship.

Commit
bc911bc5415c1b10d24a9529c74cecd068bfc8f3
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/core/dune
index 55fca7a4..a0b7034c 100644..100644
@@ -4,5 +4,5 @@
4 4 (library
5 5 (name hito_core)
6 6 (public_name hito.core)
7 Removed: (modules units muscle exercise recovery prescription evidence progression)
7 Added: (modules units exercise recovery prescription evidence progression)
8 8 (wrapped false))
lib/core/exercise.ml
index 9186ef5f..06bd6529 100644..100644
@@ -1,3 +1,22 @@
1 Added: module Muscle = struct
2 Added: type t =
3 Added: | Pecs
4 Added: | Delts
5 Added: | Triceps
6 Added: | Biceps
7 Added: | Forearms
8 Added: | Lats
9 Added: | Traps
10 Added: | Erectors
11 Added: | Quadriceps
12 Added: | Hamstrings
13 Added: | Glutes
14 Added: | Calves
15 Added: | Abdominals
16 Added:
17 Added: let equal = ( = )
18 Added: end
19 Added:
1 20 type id = string
2 21 type mechanic = Isolation | Compound
3 22
lib/core/muscle.ml
index edefd221..00000000 100644..000000
@@ -1,32 +0,0 @@
1 Removed: type t =
2 Removed: | Pecs
3 Removed: | Delts
4 Removed: | Triceps
5 Removed: | Biceps
6 Removed: | Forearms
7 Removed: | Lats
8 Removed: | Traps
9 Removed: | Erectors
10 Removed: | Quadriceps
11 Removed: | Hamstrings
12 Removed: | Glutes
13 Removed: | Calves
14 Removed: | Abdominals
15 Removed:
16 Removed: let name = function
17 Removed: | Pecs -> "pecs"
18 Removed: | Delts -> "delts"
19 Removed: | Triceps -> "triceps"
20 Removed: | Biceps -> "biceps"
21 Removed: | Forearms -> "forearms"
22 Removed: | Lats -> "lats"
23 Removed: | Traps -> "traps"
24 Removed: | Erectors -> "erectors"
25 Removed: | Quadriceps -> "quadriceps"
26 Removed: | Hamstrings -> "hamstrings"
27 Removed: | Glutes -> "glutes"
28 Removed: | Calves -> "calves"
29 Removed: | Abdominals -> "abdominals"
30 Removed:
31 Removed: let equal = ( = )
32 Removed: let pp ppf t = Format.pp_print_string ppf (name t)
lib/core/muscle.mli
index d0945045..00000000 100644..000000
@@ -1,20 +0,0 @@
1 Removed: (** Training targets used to validate pre-exhaust pairings. *)
2 Removed:
3 Removed: type t =
4 Removed: | Pecs
5 Removed: | Delts
6 Removed: | Triceps
7 Removed: | Biceps
8 Removed: | Forearms
9 Removed: | Lats
10 Removed: | Traps
11 Removed: | Erectors
12 Removed: | Quadriceps
13 Removed: | Hamstrings
14 Removed: | Glutes
15 Removed: | Calves
16 Removed: | Abdominals
17 Removed:
18 Removed: val name : t -> string
19 Removed: val equal : t -> t -> bool
20 Removed: val pp : Format.formatter -> t -> unit
test/dune
index f63d9a23..2881db49 100644..100644
@@ -3,7 +3,6 @@
3 3 (modules
4 4 test_hito
5 5 test_units
6 Removed: test_muscle
7 6 test_exercise
8 7 test_recovery
9 8 test_prescription
test/test_hito.ml
index 3b391feb..144674cc 100644..100644
@@ -6,6 +6,6 @@
6 6
7 7 let () =
8 8 Alcotest.run "hito"
9 Removed: (Test_units.suite @ Test_muscle.suite @ Test_exercise.suite
10 Removed: @ Test_recovery.suite @ Test_prescription.suite @ Test_evidence.suite
11 Removed: @ Test_progression.suite @ Test_service.suite)
9 Added: (Test_units.suite @ Test_exercise.suite @ Test_recovery.suite
10 Added: @ Test_prescription.suite @ Test_evidence.suite @ Test_progression.suite
11 Added: @ Test_service.suite)
test/test_muscle.ml
index ef0f627f..00000000 100644..000000
@@ -1,21 +0,0 @@
1 Removed: (** Unit tests for {!Muscle}, authored against the muscle.mli contract. *)
2 Removed:
3 Removed: let muscle_tests =
4 Removed: [
5 Removed: ( "names identify targets",
6 Removed: `Quick,
7 Removed: fun () ->
8 Removed: Alcotest.(check string) "pecs" "pecs" (Muscle.name Muscle.Pecs);
9 Removed: Alcotest.(check string) "lats" "lats" (Muscle.name Muscle.Lats) );
10 Removed: ( "equal distinguishes targets",
11 Removed: `Quick,
12 Removed: fun () ->
13 Removed: Alcotest.(check bool)
14 Removed: "pecs = pecs" true
15 Removed: (Muscle.equal Muscle.Pecs Muscle.Pecs);
16 Removed: Alcotest.(check bool)
17 Removed: "pecs <> lats" false
18 Removed: (Muscle.equal Muscle.Pecs Muscle.Lats) );
19 Removed: ]
20 Removed:
21 Removed: let suite = [ ("muscle", muscle_tests) ]