News for hackers. Stuff that matters.
Re:The Early History of F# [pdf] by bad_user on Friday January 11, 2019 @06:03AM (#18882555)
I think Scala's pattern matching is pretty cool too. I was surprised by how weak Haskell's pattern matching is by comparison (by default, I don't yet know of any GHC extensions that could help).

That said F# and Scala aren't really competitors. The real competitors are the mainstream languages, like JavaScript, Java, C# and Python and that's what their marketing should target.

Re:The Early History of F# [pdf] by Tarean on Friday January 11, 2019 @09:54AM (#18883907)
Pattern synonyms are really expressive but the complex version is kinda headache inducing:

http://hackage.haskell.org/package/lens-4.17/docs/src/Contro...

This creates a bidirectional pattern synonym - you can both match and construct values with it:

    foo :: Cons' s Char => s -> s
    foo (a :< b) = 'c' :< b
    foo other = other
Pattern synonyms make completeness checking undecidable so you need to give manual hints to get a nice api. It also wreaks cost models - is foo O(1) or O(n)?
Re:The Early History of F# [pdf] by dwohnitmok on Friday January 11, 2019 @06:13AM (#18882606)
If you're talking about custom `unapply` and `unapplySeq` functions, the equivalent-ish GHC extension is `ViewPatterns`.