Created
June 16, 2019 19:40
-
-
Save vshapenko/d7f5e068c18c06506a61ddd6079c1ce0 to your computer and use it in GitHub Desktop.
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
type Card=Card of string | |
type Domain= | |
|Card | |
|Id | |
|UserAccount | |
type Action= | |
|Add of Card | |
|GetUserAccount of Card | |
module DbContext= | |
let inline get id=getFromDb id | |
let processAction = | |
function | |
| Add card-> | |
match getFromDb card with | |
|Some x->() | |
|None->addToDb card | |
|x->() | |
let logContext= | |
let process action= printfn "%A" action | |
let processAction action= | |
DbContext.processAction action | |
logContext.process action | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment