horse: rename level -> aptitude-level in koka

This commit is contained in:
2026-02-16 12:03:04 -05:00
parent 9b3c9b22aa
commit 489457c63c

View File

@@ -53,8 +53,8 @@ pub fun style/show(this : style) : e string
Late-Surger -> "Late Surger" Late-Surger -> "Late Surger"
End-Closer -> "End Closer" End-Closer -> "End Closer"
// Starting aptitude levels. // Aptitude levels.
pub type level pub type aptitude-level
G G
F F
E E
@@ -64,36 +64,38 @@ pub type level
A A
S S
// Automatically generated. // Get the integer value for an aptitude level, starting at G -> 1.
// Comparison of the `level` type. pub fun aptitude-level/int(l: aptitude-level): int
pub fun level/cmp(this : level, other : level) : e order match l
match (this, other) G -> 1
(G, G) -> Eq F -> 2
(G, _) -> Lt E -> 3
(_, G) -> Gt D -> 4
(F, F) -> Eq C -> 5
(F, _) -> Lt B -> 6
(_, F) -> Gt A -> 7
(E, E) -> Eq S -> 8
(E, _) -> Lt
(_, E) -> Gt // Get the aptitude level corresponding to an integer, starting at 1 -> G.
(D, D) -> Eq pub fun int/aptitude-level(l: int): maybe<aptitude-level>
(D, _) -> Lt match l
(_, D) -> Gt 1 -> Just(G)
(C, C) -> Eq 2 -> Just(F)
(C, _) -> Lt 3 -> Just(E)
(_, C) -> Gt 4 -> Just(D)
(B, B) -> Eq 5 -> Just(C)
(B, _) -> Lt 6 -> Just(B)
(_, B) -> Gt 7 -> Just(A)
(A, A) -> Eq 8 -> Just(S)
(A, _) -> Lt _ -> Nothing
(_, A) -> Gt
(S, S) -> Eq // Comparison of the `aptitude-level` type.
pub fun aptitude-level/cmp(this : aptitude-level, other : aptitude-level) : e order
cmp(this.int, other.int)
// Automatically generated. // Automatically generated.
// Fip comparison of the `level` type. // Fip comparison of the `aptitude-level` type.
pub fun level/order2(this : level, other : level) : order2<level> pub fun aptitude-level/order2(this : aptitude-level, other : aptitude-level) : order2<aptitude-level>
match (this, other) match (this, other)
(G, G) -> Eq2(G) (G, G) -> Eq2(G)
(G, other') -> Lt2(G, other') (G, other') -> Lt2(G, other')
@@ -119,8 +121,8 @@ pub fun level/order2(this : level, other : level) : order2<level>
(S, S) -> Eq2(S) (S, S) -> Eq2(S)
// Automatically generated. // Automatically generated.
// Shows a string representation of the `level` type. // Shows a string representation of the `aptitude-level` type.
pub fun level/show(this : level) : string pub fun aptitude-level/show(this : aptitude-level) : string
match this match this
G -> "G" G -> "G"
F -> "F" F -> "F"