Danyl Novhorodovdanyl.hashnode.dev·Jun 5, 2024Why F# Outshines C# for Startups and Scale-upsAs a CTO, choosing the right programming language for your business can significantly impact your bottom line. If you are looking into Microsoft stack, .NET comes as a way-to-go solution. And it is a no-brainer, it is a rich platform with batteries i...Discuss·11 likes·223 readsF#
Jindřich Ivánekjindraivanek.hashnode.dev·May 30, 2024F# tips weekly #16: Asynchronous memoizeCaching the results of asynchronous functions is a common task. Can we use memoize for it? Let's find out! Memoized Task Surprisingly, task works great with the basic memoize function from Tip #14. If we use a function that returns Task<_>, we get a ...Discuss·1 like·262 readsF# tips weeklyF#
Jindřich Ivánekjindraivanek.hashnode.dev·May 16, 2024Problem with NaN equalityI recently encountered a bug that was caused by a special equality definition on a NaN value. NaN means not-a-number, and it's special floating-point number value, representing result of impossible operation. This issue shows how NaN can introduce ha...Discuss·11 likes·435 reads#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·May 9, 2024F# tips weekly #15: Recursive memoizeMemoization of a recursive function can be often useful, but has some pitfalls compared to memoization of a simple function. Let's take a detailed look. Standard Memoization Let's use the classical example of computing the n-th item in the Fibonacci ...Discuss·1 like·310 readsF# tips weekly#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Apr 25, 2024F# tips weekly #14: MemoizeThe memoize function is my favorite method for solving performance problems. Its significant advantage is that it requires only a slight change in code, which doesn't increase the complexity of the original code. Despite its short implementation, it ...Discuss·1 like·430 readsF# tips weeklyF#
Jindřich Ivánekjindraivanek.hashnode.dev·Apr 18, 2024F# tips weekly #13: OperatorsUsing operators like =, +, && or |> is daily bread of writing F#. Let's look at how they work under the hood. Operator is a function Every operator can be used as standard function by enclosing it in parentheses, for example (+) 1 2 is the same as 1...Discuss·1 like·315 readsF# tips weeklyF#
Fxplorerblog.fxplorer.net·Apr 17, 2024Single file minimum F# Avalonia UI app with notes.After some experimentation, a minimum Avalonia app that can be ran from an .fsx file or a Polyglot Notebook. The Polyglot Notebook can be found at: https://github.com/Fxplorer/Fxplorer_www/blob/main/docs/MinimumFsharpAvaloniaApp.ipynb The .fsx script...DiscussXploring Avalonia UI in F##fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Apr 4, 2024F# tips weekly #12: Recursive active patterns - parser exampleThis week, this article will be a little different. I want to show you that we can use recursive Active Pattern to create an expression parser. While I wouldn't recommend using this instead of a library such as FParsec for parsing, I think it's very ...Discuss·1 like·376 readsF# tips weeklyF#
Jindřich Ivánekjindraivanek.hashnode.dev·Mar 28, 2024F# tips weekly #11: Active patterns (2)Continuing from the previous week, let's delve into some active pattern implementation details and advanced use cases. Single-case active pattern As mentioned in Tip #2, we can use a single-case active pattern to directly transform a value: let (|Fro...Discuss·1 like·292 readsF# tips weekly#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Mar 21, 2024F# tips weekly #10: Active patterns (1)Active patterns are a great and unique feature of F#, allowing us to extend pattern matching with custom cases. Partial Active Patterns The most basic usage is to use active patterns as switches based on input value: let (|PositiveInt|_|) x = if ...Discuss·2 likes·606 readsF# tips weeklyF#