Copyright | (c) Alexander Hakki |
---|---|
License | BSD3 |
Maintainer | ahk@ahakki.xyz |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
- class Roman r where
- data RomanSymbol
- type RomanNumeral = [RomanSymbol]
Documentation
A type class for all types that can represent roman numerals
fromRoman :: Integral b => r -> b Source #
The Class Roman implements a single Method, fromRoman, to convert to an Integral Type
Roman RomanNumeral Source # | fromRoman on a RomanNumeral also returns the expected result, if the Roman Number is not stricly "correct", such as XIIX -> 18. |
Roman RomanSymbol Source # | |
data RomanSymbol Source #
RomanSymbols from I to M
Zero is represented as the latin word Nulla
Enum RomanSymbol Source # | |
Eq RomanSymbol Source # | |
Num RomanNumeral Source # | Unlike single Roman Symbols, lists of them can implement Num in all cases. Be aware that, Roman Numerals can never be negative. |
Num RomanSymbol Source # | Roman Symbols implement Num. This has some issues, as the result of operations such as I + I can not be represented as a single Roman Numeral. Use RomanNumeral instead. |
Ord RomanSymbol Source # | |
Read RomanNumeral Source # | Overlaps instance Read [a] with a specific version, so that "xxi" -> [X, X, I] |
Read RomanSymbol Source # | Read is case insensitive |
Show RomanNumeral Source # | |
Show RomanSymbol Source # | |
Roman RomanNumeral Source # | fromRoman on a RomanNumeral also returns the expected result, if the Roman Number is not stricly "correct", such as XIIX -> 18. |
Roman RomanSymbol Source # | |
type RomanNumeral = [RomanSymbol] Source #
RomanNumerals are Lists of RomanSymbols