Skip to content

Instantly share code, notes, and snippets.

@vshapenko
Created June 16, 2019 19:40
Show Gist options
  • Save vshapenko/d7f5e068c18c06506a61ddd6079c1ce0 to your computer and use it in GitHub Desktop.
Save vshapenko/d7f5e068c18c06506a61ddd6079c1ce0 to your computer and use it in GitHub Desktop.
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