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
// Using FSharp.Data | |
type WalletData = | |
FSharp.Data.JsonProvider< | |
"""{"unspent_outputs":[{"value":9000000000},{"value":10}]}"""> | |
let getBalance publicKey = | |
let balance = | |
try | |
WalletData.Load( |
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
//Using FSharp.Data | |
type BtcData = FSharp.Data.JsonProvider<"""{ | |
"USD":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"$"}, | |
"EUR":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"€"}, | |
"GBP":{"15m":1.1,"last":1.1,"buy":1.1,"sell":1.1,"symbol":"£"} | |
}"""> | |
let prices = BtcData.Load("https://blockchain.info/ticker") | |
//prices.Eur.Buy : val it : decimal = 923.52M (at 02/02/2017) | |
//prices.Gbp.Sell : val it : decimal = 794.61M (at 02/02/2017) |
- Lean and Functional Programming - Bryan Hunter
- A tour of the language landscape - Yan Cui
- Enterprise Tic-Tac-Toe -- A functional approach - Scott Wlaschin
- Learning from Haskell - Venkat Subramaniam
- Computation expression in context : a history of the otter king - Andrea Magnorsky
- Type-Driven Development - Mark Seemann
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 CategoryFunc = float -> float | |
type Category = string * CategoryFunc | |
module private CategoryRandom = | |
let r = System.Random() | |
let from n = r.Next n | |
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] | |
module Category = |
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
//========================================== | |
// Working fully self-contained getting-started example for Suave Web Server scripting | |
// | |
// Note you don't need to have _anything_ installed before starting with this script. Nothing | |
// but F# Interactive and this script. | |
// | |
// This script fetches the Paket.exe component which is referenced later in the script. | |
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been | |
// downloaded by the user (by executing the first part of the script) the reference | |
// shows as resolved and can be used. |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Xml; | |
using System.Xml.Linq; | |
namespace GithubWikiDoc | |
{ |
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
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
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
// Learn more about F# at http://fsharp.net | |
// See the 'F# Tutorial' project for more help. | |
type MyObjectMessage = | |
| PrintState | |
| Set of int;; | |
let MyObject() = | |
let refVar = ref 0 | |
let dispatcher = fun message -> |
NewerOlder