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

Add type checking for all arguments #12

Open
3 of 4 tasks
orome opened this issue Nov 17, 2015 · 4 comments
Open
3 of 4 tasks

Add type checking for all arguments #12

orome opened this issue Nov 17, 2015 · 4 comments
Assignees

Comments

@orome
Copy link
Owner

orome commented Nov 17, 2015

Add more Haskellian type checking and validation by:

  • making Message a class and requiring callers to explicitly supply a Message (using message) as an argument;
  • providing a total constructor for EnigmaConfig (either using configEnigmaExcept as sketched, or typing the arguments to EnigmaConfig and passing errors to configEnigmaExcept); and
  • creating and enforcing a type for valid characters for display functions (capital letters plus space; currently forced by messageChar).

Also possibly use valid character restrictions to

  • make Mapping a class and enforce checks.

See:

@orome orome self-assigned this Nov 17, 2015
@orome orome added this to the Hackage Upload 012 - (1.0.0.0) milestone Nov 17, 2015
@orome
Copy link
Owner Author

orome commented Nov 20, 2015

Decided (788dc1f) against making Message a class and requiring callers to explicitly supply a Message as an argument.

Instead Message remains a type synonym and all arguments marked of Message type, will be processed by message.

@orome
Copy link
Owner Author

orome commented Nov 20, 2015

Decided (906d40a) against enforcing a type for valid characters for display functions.

Instead, those functions just change any non-capital letters to a space.

@orome
Copy link
Owner Author

orome commented Nov 21, 2015

Leaning against a total constructor. The only scenario where it makes sense is perhaps reading configuration strings from a file.

@orome orome modified the milestones: Hackage Upload 012 - (1.0.0.0), First Stable Release Nov 23, 2015
@orome
Copy link
Owner Author

orome commented Nov 7, 2018

Settled on exposing a total constructor (in d6740b4).

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

No branches or pull requests

1 participant