Last active
October 7, 2018 09:40
-
-
Save dbrattli/d0e491b4d26a6d454937469b72afef6e to your computer and use it in GitHub Desktop.
Callback
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
// Callback handler | |
let myCallback x = | |
printfn "Got %A" x | |
// Asynchronous function taking a callback handler | |
let asyncFun x cb = | |
let result = x * 10 | |
cb result | |
// Call function with provided callback handler | |
asyncFun 42 myCallback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment