Journal Club - Building Scalable Apps with Aardvark.Media
Functional Programming
Why use functional programming? Why use FSharp?
Scott Wlaschin: "Fsharp ... is an excellent choice for enterprise development. Here are five good reasons why you should consider using F# for your next project."
- Conciseness
- Convenience
- Correctness
- Concurrency
- Completeness
We will pick some of Scott's examples to explain functional principles and the corresponding of F# notation. For details please refer to the link https://fsharpforfunandprofit.com/why-use-fsharp/ or Scott's blog in general.
//function
let timesTwo a = a * 2
//record type
type Person = {
firstName : string
lastName : string
}
//union type
type Employee =
| Worker of Person
| Manager of list<Person>