libroman-2.0.0: arabic to roman numeral conversions

Copyright(c) Alexander Hakki
LicenseBSD3
Maintainerahk@ahakki.xyz
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Roman

Description

 

Synopsis

Documentation

class Roman r where Source #

The Class Roman implements a single Method, fromRoman, to convert to an Integral Type"

Minimal complete definition

fromRoman

Methods

fromRoman :: Integral b => r -> b Source #

Instances

Roman RomanList Source #

fromRoman on a RomanList also returns the expected result, if the Roman Number is not stricly "correct", such as XIIX -> 18.

Methods

fromRoman :: Integral b => RomanList -> b Source #

Roman RomanSymbol Source # 

Methods

fromRoman :: Integral b => RomanSymbol -> b Source #

data RomanSymbol Source #

RomanSymbols from I to M

Zero is represented as the latin word Nulla

Constructors

Nulla 
I 
V 
X 
L 
C 
D 
M 

Instances

Enum RomanSymbol Source # 
Eq RomanSymbol Source # 
Num RomanList Source #

Unlike single Roman Symbols, lists of them can implement Num in all cases. However, 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 RomanList instead.

Ord RomanSymbol Source # 
Read RomanSymbol Source #

Read is case insensitive

Show RomanSymbol Source # 
Roman RomanList Source #

fromRoman on a RomanList also returns the expected result, if the Roman Number is not stricly "correct", such as XIIX -> 18.

Methods

fromRoman :: Integral b => RomanList -> b Source #

Roman RomanSymbol Source # 

Methods

fromRoman :: Integral b => RomanSymbol -> b Source #