Exploring Haskell's type system - A Roman number type

Once in a while I need a break from my day-to-day job in C# land. Don’t get me wrong, I like the language, but it doesn’t cover all of my intellectual needs. More specifically, if I

This time it was Haskell’s turn - the last time I delved into Haskell, I hadn’t really touched its type system, only used those already in place. This time I wanted to rectify that.

Behold - the Roman number

Disclaimer: I may have only implemented a subset of the proper rules of how to write Roman numbers. If you use this type to calculate the altitude of your plane, and it doesn’t work, don’t sue me, because I give no guarantees as to the 100% correctness of the code

The Roman number cough system cough had no extraordinary mathematical capabilities - I am not aware of any systematic approach that would let you add two Roman numbers. Their only purpose must have been to attach a word to a number.

The interesting parts with regard to the type system are lines 8-22. What is defined here is

The rest is really just a fair enough implementation of how to get from something like MCMLXXXIV to 1984.

The (probably quite inaccurate) conclusions I take away from this quick splash into Haskell-land

All in all, once again, refreshing, and purifying ;)