3 ms·
I worked quite a bit with F# and Scala. I really like F# pipelines and function declaration syntax. On the other hand I've found Scala's case classes cleaner
by gazarullz 8y ago
I worked quite a bit with F# and Scala.
I really like F# pipelines and function declaration syntax.
On the other hand I've found Scala's case classes cleaner than F#'s (maybe that's because I am coming from an OOP world).
Additionally F# has a cleaner pattern matching compared to Scala.
Both languages have very good support for actor model concurrency (love akka actors and .net agents)
I think that if F# would have had a rich ecosystem the way Scala has, it could become a real contender.
(my 2 cents on F#)
- bad_user 8y agoI 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.
- dwohnitmok 8y agoIf you're talking about custom `unapply` and `unapplySeq` functions, the equivalent-ish GHC extension is `ViewPatterns`.
- Tarean 8y agoPattern synonyms are really expressive but the complex version is kinda headache inducing: http://hackage.haskell.org/package/lens-4.17/docs/src/Control.Lens.Cons.html#%3A< 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)?
- pjmlp 8y agoAs someone that spends most of my work time on .NET, it would be nice if the .NET team would take F# into consideration in some of their design and tooling decisions, instead of looking just into VB.NET and C#. As it is, F# is like the cousin that doesn't always get the party invitations, while JavaScript, Python and C++ get the them, even if they don't belong to the club originally.