-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roman-numerals: No test cases for Nothing
?
#460
Comments
This was the result of the discussion in #304, implemented in #328. This way the type shows that the conversion is not always possible, but leave students the ability to extend the solution, dealing with numbers bigger than 3000.
I would avoid testing against anything bigger than 3000. About zero and negative numbers, @petertseng's comment summarizes the options.
Seems a nice idea!
|
It would be nice if Haskell had a type for strictly positive numbers... For non-negatives I found Natural, that now is part of base, but that still leaves zero. I guess what I really want are dependent types. :) |
@rbasso Yes, that would be nice. Or have a
|
Not sure if we should do that. Dealing with exceptional values is very language-dependent, and some languages are probably using unsigned numbers and cannot test for negatives. |
@rbasso No, I meant about adding |
Did you find anything there that makes reference to the direction of the conversions? Edit: If you want to make it clearer there that the conversion can be made in both direction, of course it can be changed. 👍 |
Is that something that could be discussed on |
Sure! |
What shall we do about this one? |
It seems that The conversion from roman numerals seems to be a very different problem from the reverse one, and is also a little harder, right? So I see the point that it may not be part of the same exercise. What I think that makes it interesting is that it parses in a very unusual way, e.g.:
But I don't know if that, by itself, will make an interesting exercises. In fact, I have no idea of what makes a problem interesting and sometimes I get really surprised about some exercises. For example, |
Don't know if I understand you here correctly: Isn't But I agree that I guess what is interesting is a matter of individual taste and knowledge (and what effort you are willing to invest) more than anything else. A beginner will probably come to a very different judgement from yours. :) |
Sorry...bad example. Invalid. :) |
In fact I do have a local |
If the thought is that fromRoman would not be accepted to x-common, then as of exercism/DEPRECATED.trackler#24 it is possible to this track to define it as a track-specific exercise. |
The return type of
Roman (numerals)
has been changed to aMaybe
, but there are no test cases forNothing
? Shouldn't we add some for this to make more sense?Another question that came to my mind: This exercise (or a new one) could also include the inverse conversion from Roman numeral to an
Int
? Would be cheap to add as one could just reuse the existing test cases.The text was updated successfully, but these errors were encountered: