Typeclasses Demystified

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 2

  • @MrDejvidkit
    @MrDejvidkit 7 дней назад

    I appreciate the talk; maybe more examples next time would be useful, or examples of using the library. For example, java uses Jackson, so here you can use Circle or Upickle for that, and the developer experience is even friendlier. You constructed a part of the library by yourself.
    So you could show an example with case class Person(age, name) derives JsonSerializer, BinarySerializer
    or how more case classes compose together without extra code
    case class Email(..) drivers JsonSerializer
    case class Person(name : String, age : Int, email : Email) derives JsonSerializer

    • @MrDejvidkit
      @MrDejvidkit 7 дней назад

      Also the main advantage is not to use inheritance so you can add functionality without extending "base classes" with extra methods. I think this is the most powerful feature if case classes. You can define something in a library and then you can provide your own type class instances and library can work with this.