Skip to content
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

discussion: Making the Haskell track more idiomatic #194

Closed
4 of 6 tasks
rbasso opened this issue Jul 10, 2016 · 4 comments
Closed
4 of 6 tasks

discussion: Making the Haskell track more idiomatic #194

rbasso opened this issue Jul 10, 2016 · 4 comments
Labels

Comments

@rbasso
Copy link
Contributor

rbasso commented Jul 10, 2016

Making the Haskell track more interesting #192
Making the Haskell track more idiomatic

With #115 we started to review some exercises to make them feel more like Haskell. As a result, we did the following:

  • Changed the return type of rna-transcription to a Maybe
  • Changed the return type of phone-number to an Either String
  • Changed the return type of nucleotide-count to a Maybe

There are many other unidiomatic things that can appear in the track:

  • Single letters represented as Strings.
  • Using Int when Integer makes more sense.
  • Use Integer when any Integral can be used.
  • Partial functions instead of returning Maybe.
  • Requiring lists when any Foldable is possible.
  • ...

This doesn't means that we should change everything that is not idiomatic, because sometimes unidiomatic code can be easier for beginners. But we should not allow it when it it not clear that it is the case.

List of unidiomatic things in the track we could fix
List of things we could do to promote idiomatic programming
Anyone knows of any specific thing that could/should be changed to make this track more idiomatic?
@rbasso rbasso changed the title Making the Haskell track more idiomatic discussion: Making the Haskell track more idiomatic Jul 10, 2016
@rbasso
Copy link
Contributor Author

rbasso commented Jul 25, 2016

Should roman-numerals return a Maybe, or Either, if n > 3000 or n < 1?

@petertseng
Copy link
Member

I would find Maybe String good.

Note that if truly desired, 3999 could be allowed.

@rbasso
Copy link
Contributor Author

rbasso commented Jul 30, 2016

Note that if truly desired, 3999 could be allowed.

Makes perfect sense. 😄
We should also change 3000 to 3999 in x-common.

@rbasso
Copy link
Contributor Author

rbasso commented Sep 18, 2016

Considering that is issue is open for a while and that we have opened issues to deal with all the agreed changes, I'm closing this PR now, so that we can focus on the more practical issues.

If anyone opposes, I will reopen it immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants