I earlier wrote about some ideas I had to combine the encapsulation of abstract data types with the swift case analysis plus decomposition of algebraic types. Why not have both worlds?
Ok, when looking more into F# – after a few years of trying to stay away from it – I realize that it does have such facilities, i.e., using the beauty of pattern matching with non-syntactical thingies. They call it Active Patterns. This article is pretty good. Read it, cause it is a really powerful, and apparently often overseen, feature.
Why did not anyone tell me?! You could have saved me hours of thinking about it! Ok, my informal proposal is deeper – of course – but nevertheless..NET abstract data type active pattern adt algebraic data type Functional Programming ocaml pattern