Climbing grades representation and conversion
Conversions are based in two tables
Collect methods for a GradeT pseudo-typeclass
Climb.Systems.AnyBoulder.Grade
Generic Boulder grade. Sum type of all supported grades
Climb.Systems.AnyRoute.Grade
Generic Route grade. Sum type of all supported grades
Climb.Systems.Hueco.Grade
American V-grades system
Climb.Systems.Font.Grade
Fontainebleau system
Climb.Systems.Fr.Grade
French system for grading routes
Climb.Systems.Us.Grade
American Decimal system for grading routes
Climb.Systems.Br.Grade
Brazilian system for grading routes
Required as the first argument of may functions in order to specify the desired grading system.
boulder : System Boulder
Generic bouldering grade.
route : System Route
Generic route grade.
vgrade : System VGrade
The Hueco/Vermin system used for bouldering in the USA, .i.e., the v-grades.
font : System Font
French Fontainbleau system for bouldering.
fr : System Fr
The French system.
us : System Us
The Yosemite Decimal System used in the USA.
br : System Br
The Brazillian system.
showGrade : System a -> a -> String
Render grade as a string
toAnyGrade : System a -> System b -> Basics.Bool -> b -> String
Render Bouldering grade in destT format.
The boolean argument tells if the final grade should be simplified or not in the final rendering.
toFont : System a -> Basics.Bool -> a -> String
Alias to toGrade font
toVGrade : System a -> Basics.Bool -> a -> String
Alias to toGrade vv
parseGrade : System a -> String -> Maybe a
Parse string representing grade
parseGrade vv "V10/11" ==> Just (Grade 10 HalfwayNext)
parseGrade_ : System a -> String -> a
Parse string representing grade.
If parsing fails, return the default base/zero grade. This should never be used to handle user input.
parse_ vv "V10/11" ==> Grade 10 HalfwayNext
fromAnyGrade : System a -> System b -> String -> Maybe b
Try to read string in the src format.
fromVGrade : System a -> String -> Maybe a
Alias to fromGrade vv
fromFont : System a -> String -> Maybe a
Alias to fromGrade font
toLinearScale : System a -> a -> Basics.Float
Convert to the floating point universal scale
This is useful to convert to different grading systems or saving in a database.
font =
grade
|> Font.toLinearScale
|> Hueco.fromLinearScale
fromLinearScale : System a -> Basics.Float -> a
Convert from the floating point universal scale
For bouldering, the floating point scale is based in the American
Hueco/Vermin system. i.e. fromLinearScale 10.0
refers to V10,
which is 7c+ in Fontainbleau scale.
simplifyGrade : System a -> a -> a
Remove modifiers from grade
parseGrade_ vv "V10+"
|> simplify vv
==> Grade 10 Base
nextGrade : System a -> a -> a
Next full grade ignoring modifiers
zeroGrade : System a -> a
The lowest grade in the scale
Different scales may start from different levels
compareGrades : System a -> a -> a -> Basics.Order
Compare two grades
This can be used in sorting algorithms like List.sortWith