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

Suggestions for lecture on patterns and exceptions w06: Mathcable, Nothing, Union types, etc #608

Open
bjornregnell opened this issue Oct 5, 2021 · 1 comment

Comments

@bjornregnell
Copy link
Member

bjornregnell commented Oct 5, 2021

  • Add slide on the scala type hierarchy including Matchable and Nothing
  • Show pitfall that if then without else gives type Unit and potentially lost values
  • Improve example on typed patterns, find and example that is more practically justified
  • Show that thrown exceptions has type nothing
  • Show that union types can be a simpler (but more primitive) alternative to subtyping / basetype to acheive a more precise type than Matchable
  • Show a more complete translation of enum Color { case Red, Black } into a trait -- case class expansion.
  • Explain Exception Error Throwable, Consider explaining this in carola example
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