In this post I want to share a short recap of first Wrocław Scala Java Group (WSUG) meetup. This will be kind of TIL entry, it doesn’t aim to cover the full presentation content. You can find the full agenda at the event page. If you’d like to join the next meeting, join us at Wroclaw Java User Group at meetup.com.

We just had one talk this time, and it was delivered by yours truly.

Typesafe techniques for better sleep at night

My talk was focused on showig how you can benefit from features of scala type system. This talk is an extension of my blog post on refined https://blog.michal.pawlik.dev/posts/scala/refined/. In the first part I familiarize the audience with the library, afterwads we build a simple app by combining refined for domain modelling, circe for JSON and Tapir for API modelling.

You can find the slides at https://slides.com/majkp/typesafe-techniques-wjug

Things I learned

We had a great discussion after the presentation, I’ve learned that a lot of people found interest in this topic. During the Q&A session we discussed how this affect testing, since when you model the data more precisely you get to write less tests. The question was is it actually a good think to have less tests?

Besides the discussion I’ve got two extra outcomes about the presentation itself:

  • Consider adding a bit about building API clients using tapir
  • Discuss more aspects of using refined like
    • How to test if something compiles?
    • Mention that refined types are not perfect for top level types
    • Talk about refined relation to value classes in your code
    • Note about downsides of premature use of refined