Jindřich Ivánekjindraivanek.hashnode.dev·2 hours agoF# 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 ...DiscussF# 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·175 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·310 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·241 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·1 like·552 readsF# tips weeklyF#
Jindřich Ivánekjindraivanek.hashnode.dev·Mar 14, 2024Infinity ♾ forecast bugAt one of our customer project at Ciklum Western Europe, we encountered an interesting bug after migrating to .NET8 from .NET6. The project is a weather forecast service written in F# that provides weather forecast data from various weather forecast ...Discuss·218 readsdotnet
Jindřich Ivánekjindraivanek.hashnode.dev·Mar 7, 2024F# tips weekly #9: ShadowingShadowing is one of the core design choices of the F# language. Although it may seem like a simple feature, allowing us to define a new binding with the same name as an existing one, there are multiple, sometimes surprising, implications and use case...Discuss·1 like·309 readsF# tips weekly#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Feb 29, 2024F# tips weekly #8: Custom equality and comparison (2)This week, we continue with custom comparison. Let's deep dive into writing custom comparisons. If we examine the last example of custom comparison: [<CustomEquality; CustomComparison>] type Record = { Id: int; Name: string; ActivityLog: string list ...Discuss·1 like·222 readsF# tips weekly#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Feb 22, 2024F# tips weekly #7: Custom equality and comparison (1)Last week, we explored structural equality and comparison. This week, we'll look how structural equality and comparison is implemented, and how we can alter default behavior, or define custom comparisons and equality for our types. Equals, GetHashCod...Discuss·2 likes·227 readsF# tips weekly#fsharp