Attached: whydontyouwritefsharp.png (648x368, 21K)
F# Appreciation Thread
Jackson Peterson
Levi Ward
Damn, F# looks like THAT?
Brandon Miller
> |>
What does the merchant operand do?
Jaxson Stewart
This may be javascript soon. developer.mozilla.org
github.com
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))
Luke Collins
that last line should be
List.map([1, 2, 3], fun x -> x * 2)
Brody Stewart
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)
}
});
}
Connor Martinez
Doesn't Scala do the same? I remember seeing the same construct being used for form validation.
Jack Sanchez
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.
Brody Barnes
Hudson Bennett
>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
Cameron Sanders
Aiden Gutierrez
kek
Thomas Nelson
Rust is verbose as fuck IRL, that's just a uniquely decent looking snippet
Nathaniel Garcia
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?
Brayden Fisher
That looks like fucking javascript m8
Michael White
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.
Christopher Roberts
How do I do quicksort in this
Nathan Brown
hot
Ayden Diaz
F# is a really nice language I wish it was more popular
Gavin Brooks
Cool Ocaml for .net
But still second citizen status in .net ecosystem
Cameron Rivera
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#
Anthony Jenkins
Scala, Rust, OCaml, F#
Which does Jow Forums like most? What does Jow Forums think of the others?
Nathaniel Long
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
Thomas Jackson
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
Isaac Miller
cant unsee
Christopher Anderson
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
Joseph Howard
ugh no, F# actually has the following compared to OCaml
- unsigned ints
- proper multicore support
- units of measure
- computational expressions
Jace Roberts
Which functional language should I learn? I already learnt a bit of OCaml.
Ryan Perry
Without either modules or HKTs F# will always be feature deficient.
Aaron Morris
Python and/or JavaScript
Nathan Allen
Doesn't matter much, so just keep at it.
Austin Thompson
Yikes
Isaac Foster
F# has modules
Xavier Wright
First class modules like ocaml?