Re: [Haskell-cafe] Roman Numeral Problem

2013-06-25 Thread kusimari share
Coincidence. I blogged about this today http://kusimari.blogspot.in/2013/06/roman-numerals-using-parser-combinators.html. I can share the haskelish python code offline, assuming this is not needed to pass the thoughtworks code submission. It more or less resembles what Richard has written. -Santh

Re: [Haskell-cafe] Roman Numeral Problem

2013-06-24 Thread Richard A. O'Keefe
An important question here is whether you want to notice when a Roman numeral is invalid, e.g., iix, or not. From a parsing point of view context-free grammars are not ideal. We have the patterns i{1,3} | iv | vi{1,3} | ix units x{1,3} | xl | lx{1,3} | xc

Re: [Haskell-cafe] Roman Numeral Problem

2013-06-24 Thread Roel van Dijk
Hi Christopher, I made a small library to convert between strings and roman numerals [1]. It didn't use much abstraction. I mainly used some type-classes so multiple string-like types can be parsed. The numerals themselves are basically a concatenation of value symbols. The order from high to low

[Haskell-cafe] Roman Numeral Problem

2013-06-23 Thread Christopher Howard
Hi. I am working on some practice programming problems, and one is the Roman numeral problem: write a program that converts Roman numerals into their (arabic) numeral equivalent. I imagine I could hack something together, but I was trying to think about the problem a bit more deeply. I don't know m