© 2023 Hashnode
#f
What are Computation Expressions? Computation Expressions (CE's) in F# are all about syntactic convenience. There are two different aspects: Using existing CEs: seq, query, async, task and lazy Building new/custom CEs, aka building CE bui…
Learning-FSharp/Ch25-OOP-Classes/Program.fs Check out all the comments that are placed in the source file. The objective of this article is to give you an overview of classes and interfaces in F# through various examples. Before We Begin Th…
https://youtu.be/GPCOoB778DM This article is a continuation of Basics 09 - Pattern Matching (Basics). Learning-FSharp/Ch24-ActivePatterns/Program.fs Check out all the comments that are placed in the source file. Before We Begin Let's take…
https://youtu.be/7sNpvt8MUqg Learning-FSharp/Ch23-ExtendingTypes/Program.fs Check out all the comments that are placed in the source file. Extending Your Types Here's an example of a discriminated union with static and instance members: /…
https://youtu.be/pHXPFHSFI00 A Simple Case... Not Really Let's take a simple example: let add x y = x + y let result = add 1 2 So far so good. We created a function named add. Since no type declarations are used, we assume that x, y and…
https://youtu.be/4Dbr0CSi9I4 What are Recursive Functions Recursive functions are the ones that call themselves. Recursive functions are commonly used in F#. The keyword rec is used for creating recursive functions: let funcName = .... le…
https://youtu.be/SnbrJJs1lNo Both namespaces and modules are used for organizing the code in a hierarchical, logical way. Namespaces Namespaces can contain: Nested namespaces Modules Types Modules Modules are compiled to static class…
https://youtu.be/idlWuiWPwRo Learning-FSharp/Ch18-ResultPipeline/Program.fs Learning-FSharp/Ch18-ResultPipeline/Comprehensive.fs Check out all the comments that are placed in the source file. Limitation of Option Container In the last art…
https://youtu.be/x3Sl2w0t4Ak What is Double-Lifted Data Consider this: let opt: int option = Some 1 let res: Result<int option, exn> = Ok opt opt is an int option, which means value 1 is packed in option container opt is then packed in…
https://youtu.be/B3XeK965Ch8 Learning-FSharp/Ch17-OptionPipeline/Program.fs Check out all the comments that are placed in the source file. Pipeline Imagine reading/writing a piece of code like this: let result = input |> f1 |> f2 |> f3 |>…