Files
horse/horse/character.kk

18 lines
395 B
Plaintext

module horse/character
import horse/game-id
pub struct character-detail
character-id: character-id
name: string
pub fun detail(
c: character-id,
?character/show: (character-id) -> string
): character-detail
Character-detail(c, c.show)
pub fun character-detail/show(d: character-detail): string
val Character-detail(Character-id(id), name) = d
name ++ " (ID " ++ id.show ++ ")"