Skip to content

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

Open
@bjornregnell

Description

@bjornregnell
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions