let add x y = x + y let mult (x: int) (y: int) = x * y printfn "add 2 + 3 = %d" (add 2 3) printfn $"add 2 + 3 = {add 2 3}" let result = mult 2 3 printfn "mult 2 * 3 %d" (mult 2 3) printfn $"mult 2 * 3 = {mult 2 3}" printfn "mult 2 * 3 = %d" result printfn $"mult 2 * 3 = {result}" let divide = fun x y -> x / y printfn "divide 6 / 3 = %d" (divide 6 3) printfn $"divide 6 / 3 = {divide 6 3}" let operation number = if number % 2 = 0 then printfn $"number {number} is even" else printfn $"number {number} is odd" let procedure number = (2. * (number + 1.)) ** 2. printfn $"procedure 2 * (3 + 1) ^ 2 = {procedure 3.}" let add' = fun x y -> x + y let add'' x = fun y -> x + y let mult' x y = x * y let mult'' x y = x * y
Interesting now how 3 layers later, more and more JS UI frameworks are moving to signals and signals are now stage 2 and will soon become standard JS language feature. The observables you describe here sound exactly like Svelte/Solid/Angular/soon-to-be-standard-JS signals.
1:08:34 Couldn't you have written currentTime as a lambda, because the usage would have been the same, meaning you'd still have written currenTime() to call that lambda? For example, instead of let currentTime () = DateTime.Now, you could have written let currentTime = fun () -> DateTime.Now, which is perhaps slightly more self explanatory, while admittedly a bit longer to type. But it means it could work with functions that are nondeterministic but also take in arguments, and which means you could also curry them.
Hi Ben, do you have other episodes (or code) from stock market monitoring system ? It’s a great idea to build it with F# , really want to see how you’ve put it together.
All this video has proven is that you don't know enough about both languages to make this comparison. I don't doubt you know your stuff on the F# side but as others have said, you've over-complicated the solution in C#. Objectively just looking at the two side by side, C# is definitely the most understandable and clean and coming to it from any other language you could easily understand what is going on straight away without knowing C#. I definitely can't say the same for F#. The code is a mess and none of the paradigms are instantly recognisable.
Hey Ben, just wanted to thank you for your videos! I usually dont like watching youtube videos about coding, but i really enjoy yours. They are concise, just like F#. Keep going, i am hyped for the next videos!!! :--)
I'm so confused what functional programming is and why to use it :( I know OOP uses classes and objects and inheritance and stuff but idk what functional is
Hey can you also attach the program files, so that we don't have to go through the video, every time we need to look at the code of a specific topic. Would be of great help, thank you!
43:40 packages in JVM are weaker than namespaces in .NET and C++ - in JVM you can’t partially specify a name (to distinguish it from similar names), you have to specify the full package name.
You have the content but you are just a horrible teacher. You do not use a word to define itself. For example, photosynthesis is not the process of photosynthesizing, just like RunSynchronously ss not running a block synchronously
This was highly informative! I really like that it was focused on a single language feature - albeit a very flexible one. I can see this coke in handy in tests, too, where you might want to alter input data one field at a time.