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 annotations to code examples in "Getting Started" #318

Open
hdgarrood opened this issue May 20, 2020 · 4 comments
Open

Add type annotations to code examples in "Getting Started" #318

hdgarrood opened this issue May 20, 2020 · 4 comments

Comments

@hdgarrood
Copy link
Collaborator

People will probably not expect the code examples they encounter in the Getting Started guide to emit warnings, but right now, they do, because they do not include type annotations. It may be worth changing the guide to include type annotations, because beginners might think that warnings indicate a problem. See also the discussion in #305.

@hdgarrood
Copy link
Collaborator Author

I'm leaning towards doing this but I'm not completely certain.

@milesfrain
Copy link
Contributor

Leaning against this because:

  • The guide notes that warnings will appear. Maybe this point in the text just needs some emphasis.
  • These compiler warnings are fairly human-friendly.
  • The type annotations introduce more unknown and potentially confusing content.

@hdgarrood
Copy link
Collaborator Author

The types will be encountered anyway - if they're not present in the examples, then the warning suggests adding them and writes them out for you:

    No type declaration was provided for the top-level declaration of main.
    It is good practice to provide type declarations as a form of documentation.
    The inferred type of main was:
                 
      Effect Unit

@oldfartdeveloper
Copy link
Contributor

oldfartdeveloper commented Dec 29, 2022

I agree with @hdgarrood on this. But I also agree w/ @milesfrain. There are good arguments on both sides. For that reason, I don't feel it's worthwhile pursuing this any longer; it has lingered long enough. Hence agree with the earlier closing.

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

3 participants