This file contains 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
// Odin Error Challenge in F# | |
// see: https://rm4n0s.github.io/posts/3-error-handling-challenge/#odins-teachings-in-action | |
// try pasting the code into: https://sharplab.io/ | |
type F1_Error = | |
| None | |
| Account_Is_Empty | |
| Investment_Lost | |
type F2_Error = |
This file contains 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
open System | |
type Tree<'a> = | |
| Leaf of 'a | |
| Branch of Tree<'a> list | |
type StateMonad<'state, 'content> = StateMonad of ('state -> ('state * 'content)) | |
let testTree = | |
Branch [ |