Skip to content

Conversation

@blackk-foxx
Copy link
Contributor

@blackk-foxx blackk-foxx commented Feb 5, 2026

See the relevant forum discussion for context.

  • Add required infrastructure files
  • Add concept doc
  • Add exercise instructions

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

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.

@github-actions github-actions bot closed this Feb 5, 2026
@blackk-foxx
Copy link
Contributor Author

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 AtLeastOneUppercaseLetter rule. If it meets the AtLeastOneUppercaseLetter rule but violates all the others, then the tests expect specifically Error AtLeastOneLowercaseLetter.

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.

@SleeplessByte
Copy link
Member

cc @ErikSchierboom

@ErikSchierboom ErikSchierboom reopened this Feb 5, 2026
@ErikSchierboom
Copy link
Member

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.

Totally agree. This looks great.

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.

That is exactly what I was thinking of! Love that.

@blackk-foxx blackk-foxx marked this pull request as ready for review February 10, 2026 23:38
@blackk-foxx
Copy link
Contributor Author

blackk-foxx commented Feb 10, 2026

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 AtLeastOneUppercaseLetter rule. If it meets the AtLeastOneUppercaseLetter rule but violates all the others, then the tests expect specifically Error AtLeastOneLowercaseLetter.

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> =
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants