Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Excercise.hsのリファクタリング #12

Open
igrep opened this issue Oct 12, 2018 · 0 comments
Open

Excercise.hsのリファクタリング #12

igrep opened this issue Oct 12, 2018 · 0 comments

Comments

@igrep
Copy link
Member

igrep commented Oct 12, 2018

#10 でも

(だいぶ愚直なので、全体的にヒント出すとこはリファクタリングしたいですね 😅 )

と指摘されているとおり、重複が多いし、今後も増えやすいと思われる。

理想的にはおそらく、hintを組み立てる処理をMaybe monadで書き換えることで、「ヒントを付与する条件とヒントのメッセージ」を組み合わせやすくするのが好ましいとも思われる。

現状、実装上の事情を除いて複数のヒントを一度に出力することは検討していないので、WriterよりもMaybeの方がよいのではないかと思う。

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

No branches or pull requests

1 participant