libroman-3.2.0: Use Roman Numerals as a Numeric Datatype (sort of)
Copyright(c) Alexander Hakki
LicenseBSD3
Maintainerahk@ahakki.xyz
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Roman

Description

 
Synopsis

Documentation

class Roman r where Source #

A type class for all types that can represent roman numerals

Methods

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

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

Instances

Instances details
Roman RomanNumeral Source #

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

Instance details

Defined in Data.Roman

Methods

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

Roman RomanSymbol Source # 
Instance details

Defined in Data.Roman

Methods

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

data RomanSymbol Source #

RomanSymbols from I to M

Zero is represented as N for the latin word Nulla

Constructors

Nulla 
N 
I 
V 
X 
L 
C 
D 
M 

Instances

Instances details
Enum RomanNumeral Source # 
Instance details

Defined in Data.Roman

Enum RomanSymbol Source # 
Instance details

Defined in Data.Roman

Num RomanNumeral Source #

Be aware that, Roman Numerals can never be negative.

Instance details

Defined in Data.Roman

Read RomanNumeral Source #

Overlaps instance Read [a] with a specific version, so that "xxi" -> [X, X, I]

Instance details

Defined in Data.Roman

Read RomanSymbol Source #

Read is case insensitive

Instance details

Defined in Data.Roman

Integral RomanNumeral Source # 
Instance details

Defined in Data.Roman

Real RomanNumeral Source # 
Instance details

Defined in Data.Roman

Show RomanNumeral Source # 
Instance details

Defined in Data.Roman

Show RomanSymbol Source # 
Instance details

Defined in Data.Roman

Eq RomanSymbol Source # 
Instance details

Defined in Data.Roman

Ord RomanNumeral Source # 
Instance details

Defined in Data.Roman

Ord RomanSymbol Source # 
Instance details

Defined in Data.Roman

Roman RomanNumeral Source #

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

Instance details

Defined in Data.Roman

Methods

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

Roman RomanSymbol Source # 
Instance details

Defined in Data.Roman

Methods

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

type RomanNumeral = [RomanSymbol] Source #

Roman Numerals are represented as Lists of RomanSymbols