Created
May 25, 2015 10:33
-
-
Save bjartwolf/e00fcb0a4e835578c6f9 to your computer and use it in GitHub Desktop.
person.fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Person = { id: Guid; name: string; age: int} | |
let bjorn = { id=System.Guid.NewGuid(); name="Bjørn Einar"; age=34} | |
let changedName = {bjorn with name = "Bjørn the confused"} | |
let changeAge (p:Person) (newAge:int) = | |
// somecrazybusiness rules with age and using services to check if the | |
// age is really correct and do all kinds of sideeffects | |
{p with age = newAge} | |
let changedAgedBjorn = changeAge changedName 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment