Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Top 5 Cool Things about Scala 3 (that are not enums)

Top 5 Cool Things about Scala 3 (that are not enums)

Top 5 Cool Things about Scala 3 (that are not enums)

....because of course Scala 3 enums are the coolest!

Daniela Sfregola

April 23, 2021
Tweet

More Decks by Daniela Sfregola

Other Decks in Technology

Transcript

  1. Top 5
    Cool Things about
    Scala 3
    that are not enums
    @DanielaSfregola
    Scala 3 Release Party - April 2021

    View full-size slide

  2. Hellooooo
    • Software Engineer 

    living in London UK

    • Scala Lover ❤

    • OS Maintainer

    • Author of 

    "Get Programming with Scala"
    by Manning


    35% OFF with code "scala3party"

    View full-size slide

  3. 5 - Improved Type Inference
    Map("Scala" -> 3).map { (k, v) => s"$k$v" }

    View full-size slide

  4. 5 - Improved Type Inference
    Map("Scala" -> 3).map { (k, v) => s"$k$v" }
    Scala 2.13.4

    View full-size slide

  5. 5 - Improved Type Inference
    Map("Scala" -> 3).map { (k, v) => s"$k$v" }
    Scala 2.13.4

    View full-size slide

  6. 5 - Improved Type Inference
    Map("Scala" -> 3).map { (k, v) => s"$k$v" }
    Scala 3.0.0

    View full-size slide

  7. 5 - Improved Type Inference
    Map("Scala" -> 3).map { (k, v) => s"$k$v" }
    Scala 3.0.0
    Scala 2.13.4

    View full-size slide

  8. 4 - Procedure Syntax
    def echo(str: String) {
    str
    }

    View full-size slide

  9. 4 - Procedure Syntax
    def echo(str: String) {
    str
    }
    Scala 2.13.4

    View full-size slide

  10. 4 - Procedure Syntax
    def echo(str: String) {
    str
    }
    Scala 2.13.4

    View full-size slide

  11. 4 - Procedure Syntax
    def echo(str: String) {
    str
    }
    Scala 3

    View full-size slide

  12. 4 - Procedure Syntax
    def echo(str: String) {
    str
    }
    Scala 3

    View full-size slide

  13. 3 - Improved Error Messages
    Arrested Developers
    What the Scala Compiler & Lucille Bluth 

    Have In Common
    by Fiona Condon, NeScala 2017
    https://www.youtube.com/watch?v=78iIbiRwFTM

    View full-size slide

  14. 3 - Improved Error Messages
    def echo(str: String): Unit = {
    str
    }
    def echoTwice(str: String): String = {
    echo(str) match {
    case x: String => s"$x$x"
    }
    }

    View full-size slide

  15. 3 - Improved Error Messages
    Scala 2.13.4

    View full-size slide

  16. 3 - Improved Error Messages
    Scala 2.13.4
    Scala 3

    View full-size slide

  17. 2 - Strict Equality
    List("Scala", "3").headOption == "Scala"

    View full-size slide

  18. 2 - Strict Equality
    List("Scala", "3").headOption == "Scala"
    Scala 2.13.4

    View full-size slide

  19. 2 - Strict Equality
    List("Scala", "3").headOption == "Scala"
    Scala 2.13.4
    Scala 3

    View full-size slide

  20. 1 - Compatibility with 2.13
    Migrating to Scala 3
    is easy* !
    * if you are using Scala 2.13
    * if you don't have macros in your code
    Scala 3 Migration Guide
    https://scalacenter.github.io/scala-3-migration-guide

    View full-size slide

  21. Thank You!
    •Twitter: @DanielaSfregola

    •"Get Programming with Scala" 

    by Manning


    35% OFF with code "scala3party"

    View full-size slide