-
-
Notifications
You must be signed in to change notification settings - Fork 195
nucleotide-count: Nucleotides have a misleading type #694
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
Comments
I agree -- an enum would make sense so the type system can help make clear there are only four possible values at each position. I would also take this opportunity to address what was said in #626 (comment)
I still think there would be value in using a I believe the files needed to edit to resolve this issue are the following:
|
I agree. But if we use a
then what's the point in having a
but then you wouldn't need the Perhaps one should keep the |
Should the tests keep asserting that the map contains all four nucleotides when a nucleotide occurred zero times? |
@sshine I personally wouldn't let the |
@isovector Do you mean something other than what I did in PR #714? |
The function
nucleotideCounts :: String -> Either String (Map Char Int)
I'd suggest has the wrong type. Nucleotides are certainly an enum and not aChar
. I worry the exercise as it stands today discourages people from thinking about data modeling and instead plays into a bias to use strings more often than they should be.The text was updated successfully, but these errors were encountered: