“Active pattern-oriented programming” feels like a discipline within DDD on its own. #fsharp
Sort a list of values by a “binary” key, then mix nested, AND and OR (active) patterns with list cons pattern to detect patterns of complex data in the original list.
Sorting is meant to push all potentially interesting values to the start of the list and treat it kind of like a set in pattern matching.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
I write #fsharp and #haskell daily (and #purescript too) and thought of making a micro-blog comparison of the two. Fun facts and maybe new discoveries for the interested, in no particular order. This will be long and probably slow.
Unlike #fsharp, #haskell has no records, only discriminated unions. It does have something called “record syntax” for DUs.
In #fsharp functions cannot be overloaded. In #haskell it is possible through the “type classes” mechanism, conceived specifically for this.