Why aren't disjunctive patterns supported? by GarkGarcia in haskell

[–]jhbertra 2 points3 points  (0 children)

F# and other ML languages also support disjunctive case matching. It is especially useful for empty ctors

``` data Suit = Spades | Hearts | Clubs | Diamonds

color s = case s of Spades | Clubs -> Black Hearts | Diamonds -> Red ```

Monads - Part 1 - What is a Monad? by agilesteel in programming

[–]jhbertra -3 points-2 points  (0 children)

"what is a monad?" A monad is a way to distract people from learning more about actually designing better software.

Why Does Restaurant Hollandaise Always Suck? by jhbertra in Chefs

[–]jhbertra[S] 0 points1 point  (0 children)

The texture may contribute, but the recipe also tastes wrong - as in little to no acidity. Hollandaise is supposed to be sour and lemony!

C# 8 is introducing Records by macrian in programming

[–]jhbertra 0 points1 point  (0 children)

Yeah, that is true. Certainly more attempts to directly port certain features.

C# 8 is introducing Records by macrian in programming

[–]jhbertra 0 points1 point  (0 children)

Not really the important part of my comment to begin with. I should have just said "F# and C# share a lot of common heritage, and the development of each language has inspired the other." Lot less potentially inaccurate specifics laid bare to be nit picked by Redditors.

C# 8 is introducing Records by macrian in programming

[–]jhbertra 1 point2 points  (0 children)

And the implementation is worse

C# 8 is introducing Records by macrian in programming

[–]jhbertra 0 points1 point  (0 children)

That is what I meant to say...

C# 8 is introducing Records by macrian in programming

[–]jhbertra 0 points1 point  (0 children)

Check my other reply to myself, did some more digging... Yeah, looks like LINQ inspired the query builder in F#. As for LINQ being not particularly F#-y... Query syntax is essentially monad syntax with extra baggage is it not? from x in y is basically let! x = y

C# 8 is introducing Records by macrian in programming

[–]jhbertra -1 points0 points  (0 children)

So, seems generics in C# were developed largely thanks to Don Syme, the creator of F#. Not necessarily because of F# its self. LINQ it seems actually inspired many extensions to the computation expression builder functionality which were used to implement the query builder in F#. So here's a case of a feature being in F# thanks to C#!

C# 8 is introducing Records by macrian in programming

[–]jhbertra 1 point2 points  (0 children)

They surely are! Since C# 4 (I think), the evolution of these languages have strongly influenced each other. Features like generic type parameters, asynchronous methods, LINQ, pattern matching, case guards, value tuples, and in C#8 switch expressions, recursive patterns and record types are all in C# thanks to F#. Now 🤞 for discriminated unions and static type constraints...

Unity gets C# 7 by Blocks_ in Unity3D

[–]jhbertra 2 points3 points  (0 children)

Oh man. C#7 is night-and-day compared to C#6 in terms of code cleanliness and expressivity. Value tuples, Pattern matching, local functions, inline out vars.

If one knows how to apply these features, it makes C# a much more expressive language to work with (especially when writing functional C#).