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

Create Product Type for each algorithm #7

Open
piu130 opened this issue Sep 13, 2019 · 0 comments
Open

Create Product Type for each algorithm #7

piu130 opened this issue Sep 13, 2019 · 0 comments

Comments

@piu130
Copy link

piu130 commented Sep 13, 2019

We should create a product type for each algorithm.

Example:

-- the function signature
sha256 : String -> String
-- becomes
sha256 : String -> SHA256 String  -- maybe we could also use ByteString later
-- or
sha256 : String -> SHA256 -- with hard-coded String type

So we can switch our functions:

-- from
ineedsha256 : String -> Whatever
-- to
ineedsha256 : SHA256 -> Whatever

There were many bugs because of untyped cryptography in the past and we should not make the same mistake with the nice typed programming language elm.

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

No branches or pull requests

1 participant