F# Appreciation Thread

Attached: whydontyouwritefsharp.png (648x368, 21K)

Other urls found in this thread:

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Pipeline_operator
github.com/tc39/proposal-pattern-matching
twitter.com/SFWRedditVideos

Damn, F# looks like THAT?

> |>
What does the merchant operand do?

This may be javascript soon. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Pipeline_operator
github.com/tc39/proposal-pattern-matching
passes the left hand side as the first argument on the right hand side
[1, 2, 3] |> List.map (fun x -> x * 2)

does the same as
List.map ([1, 2, 3], List.map (fun x -> x * 2))

that last line should be
List.map([1, 2, 3], fun x -> x * 2)

pub fn fizzbuzz() {
(1 .. 101).for_each(|n|{
match (n % 3, n % 5) {
(0, 0) => println!("FizzBuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
_ => println!("{}", n)
}
});
}

Attached: Screenshot from 2019-08-17 09-15-35.png (1284x700, 138K)

Doesn't Scala do the same? I remember seeing the same construct being used for form validation.

The best part about F# is being able to use it when you need it and sticking to C# when you don't.

That and C# constantly steals features from it.

Attached: cap-5.png (440x273, 16K)

>can't fall through from Fizz to Buzz, so need an additional rule for FizzBuzz
So this is the power of functional programming
I hope the list is lazy at least

Attached: 1545247554802.jpg (456x810, 27K)

kek

Rust is verbose as fuck IRL, that's just a uniquely decent looking snippet

Why does F# exist?
Is it better than C# at solving some kind of problem?
Legit question, I want to try a new paradigm, but does it offer any advantage over imperative or object-oriented languages?

That looks like fucking javascript m8

Imagine having the tools so that you can create abstractions that prevent over 50% of bugs if you started thinking of programs in a more abstract way.
That's functional programming, and F# has some of these tools. C# is hamfisting some of them in, and you can actually take advantage of them, but if you approach program design with the same mentality as you would mainstream OOP C#, it is little more than fluff.

How do I do quicksort in this

hot

F# is a really nice language I wish it was more popular

Cool Ocaml for .net
But still second citizen status in .net ecosystem

what is funny about F# is that the author (don syme) does not like typeclasses at all

But C# are looking to add typeclasses soon, so when that happens, F# will be forced to support typeclasses because of C#

Scala, Rust, OCaml, F#

Which does Jow Forums like most? What does Jow Forums think of the others?

Haskell, good: functor/applicative/traversable/monads, bad: lazy evaluation can cause severe performance problems that are hard to identify at first, linked lists used by default, they should be optional.
Scala, good: Java libraries, bad: too entrenched in OOP
Rust, good: performance borrowing, bad: horrid syntax and the community is a joke
OCaml, never used it so can't comment
F#, same

too brainlet for Haskell
I agree with Scala being OOP trash
Rust syntax is a tragedy
OCaml vs F# ... both are unpopular but at least F# has multicore support

cant unsee

in haskell this is just [1..100] \x ->
case (x `mod` 3, x `mod` 5) of
(0, 0) -> "Fizzbuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
(_, _) -> show x

F# is like OCaml or Haskell except with neither of the useful features of either but decent interop with other CLR langs to make up for it

ugh no, F# actually has the following compared to OCaml
- unsigned ints
- proper multicore support
- units of measure
- computational expressions

Which functional language should I learn? I already learnt a bit of OCaml.

Without either modules or HKTs F# will always be feature deficient.

Python and/or JavaScript

Doesn't matter much, so just keep at it.

Yikes

F# has modules

First class modules like ocaml?