···3737]
38383939pub type Dice {
4040+ /// A "normal" dice roll with an amount, value and a list of modifiers to apply
4041 Basic(amount: Int, value: Int, modifiers: List(Modifier))
4242+ /// A fate dice roll with an amount, and a list of modifiers to apply. Fate dice are dice with 3 results, all with an
4343+ /// equal number of faces. [Learn more](https://en.wikipedia.org/wiki/Fudge_%28role-playing_game_system%29)
4144 Fate(amount: Int, modifiers: List(Modifier))
4545+ /// A basic number and some modifiers that could be applied.
4246 Number(value: Int, modifiers: List(Modifier))
4347}
4448···4953 InvalidModifier
5054}
51555656+/// Convert a string containing algebraic dice notation into a type describing how the dice should behave when rolled.
5757+///
5858+/// ```gleam
5959+/// diced.parse("2d20kh")
6060+/// // Ok(diced.Basic(2, 20, [KeepHighest(1)]))
6161+/// ```
5262pub fn parse(string string: String) -> Result(Dice, DiceError) {
5363 let dice_splitter = splitter.new(["d", "dF"])
5464 case splitter.split(dice_splitter, string) {