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

Implementation of issue #55: Implement type annotations #56

Merged
merged 9 commits into from
Apr 15, 2022

Conversation

pgrandjean
Copy link
Contributor

No description provided.

@joroKr21
Copy link
Member

joroKr21 commented Jan 6, 2022

Thanks a lot and sorry for the delay - I will try to review this soon, but I didn't forget about it

@pgrandjean
Copy link
Contributor Author

🙏

@pgrandjean
Copy link
Contributor Author

rebased

Copy link
Member

@joroKr21 joroKr21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to review 🙈

Overall looks good, the documentation can be improved and some polishing to do.
We should also add some tests with enums - that's the future of ADTs.

Copy link
Member

@joroKr21 joroKr21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed my comments - we still need to add more tests but this PR is getting too big.

@joroKr21 joroKr21 merged commit 307a5ec into typelevel:main Apr 15, 2022
@pgrandjean
Copy link
Contributor Author

@joroKr21 thank you for all the fixes and integration!

@pgrandjean pgrandjean deleted the pgrandjean branch May 13, 2022 19:02
@pgrandjean
Copy link
Contributor Author

@joroKr21 what tests need to be added?

@joroKr21
Copy link
Member

@joroKr21 what tests need to be added?

We were lacking tests with enums - I added one though

@pgrandjean
Copy link
Contributor Author

I tried using type annotations on enums, but the following syntax is invalid:

enum Control2:
  case Automatic @First
  case Manual(age: PosInt, email: Email) @Third('!')

according to Scala's EBNF, the best I can do is:

enum Control2:
  case Automatic extends Control2 @First
  case Manual(age: PosInt, email: Email) extends Control2 @Third('!')

which kills the purpose of the new enum syntax by repeating extends Control2. If you see an interest in supporting this syntax, I can add a test.

@joroKr21
Copy link
Member

@pgrandjean this is the test I added:

@Other @Last(false) enum Control:
    @First @Third('!') case Automatic
    @Second(100, "@") case Manual(age: PosInt, email: Email)

Not sure if that corresponds to your expectations. I think you know better than me how this functionality is supposed to be used. More tests can't hurt, but at least we already have one test for sanity check, so if you want to add more it's up to you.

Btw this is not released yet. I got a bit stuck on #36 - wanted to complete it for the next release but it looks still half-baked. I'm thinking of a more useful design so I will leave if for another milestone.

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.

2 participants