-
-
Notifications
You must be signed in to change notification settings - Fork 110
Add PasswordChecker exercise for Result concept #1368
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
base: main
Are you sure you want to change the base?
Conversation
|
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
|
I believe this version achieves the mutual goals of teaching the Result concept in a focused manner and having only a minimal set of prerequisites. One drawback I see with this exercise is that it expects only a single rule violation for any given input, whereas any real-world password checker would be able to indicate when a combination of rules is violated. A related concern is the "magic" precedence of rules. For example, if a given password is of sufficient length, but violates all the other rules, then the tests expect specifically the Maybe there could be a follow-up concept exercise for Flags enums that could extend the PasswordChecker to report multiple rule violations at a time. |
Totally agree. This looks great.
That is exactly what I was thinking of! Love that. |
I think I eliminated this problem by narrowing the tests to test only a single rule violation at a time. |
| | AccessDenied | ||
| | FileLocked | ||
|
|
||
| let openFile (filename: string) : Result<int, FileOpenError> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing that the doc check is failing on this line (but it is hard to tell since the error message does not indicate a line number). Any suggestions on how to remedy this? I could add a function body like failwith "Not implemented" but I fear that would be a distraction. Ideally, I would like to exclude line 57 from the doc check.
See the relevant forum discussion for context.