Here’s a nice simple article explaining enhanced enums that have been around for a while but may be something overlooked. Between these and sealed classes I think Dart has an excellent story for pattern matching.

  • anlumo@feddit.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 months ago

    The whole point of the discussion is that enhanced enums don’t do anything in practice.

    • Problematic Consumer@lemmy.worldM
      link
      fedilink
      arrow-up
      1
      ·
      9 months ago

      Instead of writing verbose extensions and functions all over the place you can use enhanced enums. I mean what else are they supposed to do?