This is the sequence of steps to follow to create a root gh-pages
branch. It is based on a question at [SO]
cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
module Event = | |
open System.Threading | |
let concat (source: IEvent<IEvent<_,_>>) = | |
let event = new Event<_>() | |
source.Add (Event.listen event.Trigger) | |
event.Publish | |
let collect f = | |
Event.map f >> concat |
#r "System.dll" | |
open System | |
open System.Diagnostics | |
// NOTE: A special version for primitives would increase | |
// performance for primitive types, especially for I/O, | |
// byte-based operations. | |
// [snippet: Circular Buffer] | |
type CircularBuffer<'a> (bufferSize: int) = |
// helpers to iterate IDiaEnum* objects | |
let inline toSeq (o: ^T) = | |
let e = { new IEnumerable with member this.GetEnumerator () = (^T: (member GetEnumerator: unit -> _) (o)) } | |
if true then | |
Seq.cast e | |
else | |
// Dummy expression to constrain return type to that of o.Item | |
seq [| (^T: (member Item: _ -> _) (o, Unchecked.defaultof<_>)) |] |
open System | |
open System.Net | |
// exception handling in async using Async.Catch | |
let fetchAsync (name, url:string) = | |
async { | |
let uri = new System.Uri(url) | |
let webClient = new WebClient() | |
let! html = Async.Catch (webClient.AsyncDownloadString(uri)) | |
match html with |
#r @"bin\debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl | |
open System | |
open FsControl.Core.Abstractions | |
// generic composition operators for all categories | |
let inline (>>) g f = Inline.instance (Category.Comp, f) g | |
let inline (<<) f g = Inline.instance (Category.Comp, f) g | |
// Lens definition |
#r @"bin\debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl | |
open System | |
open FsControl.Core.Abstractions | |
// generic semigroup operator | |
let inline mappend x y = Inline.instance (Monoid.Mappend, x) y | |
// generic functor operators | |
let inline fmap f x = Inline.instance (Functor.Fmap, x) f |
#r @"bin\Debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl | |
module Monad = | |
open FsControl.Core.Abstractions | |
let do' = new Monad.DoNotationBuilder() | |
module MonadPlus = | |
open Monad | |
open FsControl.Core.Abstractions.MonadPlus |
open System | |
type ZipBuilder() = | |
member t.Zip(xs,ys) = List.zip xs ys | |
member t.For(xs,f) = List.collect f xs | |
member t.Yield x = [x] | |
member t.Select(xs,f) = | |
List.map f xs | |
member t.Zero() = [] |
// Install http://www.nuget.org/packages/Fleece | |
open Fleece | |
open FSharpPlus | |
let json = """{ | |
"1": "one", | |
"2": "two", | |
"3": "three" | |
}""" |