AWS Community Day CPH - Three problems of Terraform
Â
Getting the MVVM Kicked Out of Your F#'n Monads
1. Getting the MVVM kicked out of your F#'n Monads Richard Minerich F# MVP of the Year Senior Researcher, Bayard Rock @Rickasaurus / [email_address] Fill this space with whatever you want (graphic, logo, whatever)
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21. â F# 2.0 is a book that assumes you are a professional, and as such, does not waste your time with a lot of fluff.â
22.
23. We thank the following companies for their gracious sponsorship Platinum Sponsor Gold Sponsors Silver Sponsors
Hinweis der Redaktion
Where we put the parens doesnât matter, the result will be equal
We can combine the functions by calling them one after another, but this isnât really an operation, just passing
This ends up having same effect as stacking functions inside calls to each other, but is much more flexible. Now, we can do a lot of things with functions that would could only do with numbers before.
This is called the identity F# comes with the id function built in
This is called the identity F# comes with the id function built in
This is associativity all stateless functions share this property because execution is delayed
The >> operator demands associtivity and so everything must be defined in a way that enforces it
Because minusTwo, minusOne and minusThree are really the same as addNegativeOne, addNegativeTwo and addNegativeThree The order of calculation is in the order in which things are appended.
For this same reason, our addition functions have exactly the same properties as addition itself. You can put parans anywhere you want but you canât reorder without breaking the function
But first we need to revisit some very basic math. Trust me, it will be worth it.
Computation expressions let us define the relationships between things in a specific context. Letâs take this apart.
But donât worry, weâll take it slow
Letâs take small steps first. Look at this code.
With this pattern, everything is designed in terms of merging containers, putting things in the container or pulling things out
With a maybe monad, we can pretend like the maybe isnât even there