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
let trampoline f c n = | |
let rec loop = function | |
| Choice1Of2 x -> x | |
| Choice2Of2 x -> loop (f x) | |
loop (Choice2Of2 (c,n)) | |
// Test | |
let factorial n = | |
let rec factorialT (current, n) = | |
if n = bigint 0 then Choice1Of2 current |
type Json = | |
| Null | |
| Bool of bool | |
| Number of float | |
| String of string | |
| Array of Json list | |
| Object of (string * Json) list | |
type Bracket = Open | Close |
Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)
The following steps are mostly taken from this guide and it's only necessary to do them once:
package eventsourcing | |
import java.time.Instant | |
import cats._ | |
import cats.data.Coproduct | |
import cats.free.{Free, Inject} | |
import cats.implicits._ | |
import doobie.imports._ | |
import fs2.Stream |
open System | |
type Interval = | |
| PerfectUnison | |
| MinorSecond | |
| MajorSecond | |
| MinorThird | AugmentedSecond // Enharmonically the same in 12TET | |
| MajorThird | |
| PerfectFourth | |
| DiminishedFifth | AugmentedFourth // Enharmonically the same in 12TET |
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 |
#load @".paket\load\net452\FSharpPlus.fsx" | |
open FSharpPlus | |
open System | |
[<AutoOpen>] | |
module rec IO = | |
let run (IO computation) = computation() | |
type IO<'T> = |
// This F# language suggestion wants a way to name collections of constraints: | |
// http://fslang.uservoice.com/forums/245727-f-language/suggestions/8509687-add-constraints-as-a-language-construct | |
// | |
// This is a type alias X<T> = T, so X<int> = int etc. | |
type X<'T> = 'T | |
// This is a type alias X<T> = T which adds a constraint | |
type WithStruct<'T when 'T : struct> = 'T |
#load @"paket-files/fsprojects/Chessie/src/Chessie/ErrorHandling.fs" | |
type Continuation<'output, 'next> = 'output -> 'next | |
module TerminalDsl = | |
open Chessie.ErrorHandling | |
type Terminal<'next> = | |
| WriteLine of string * Continuation<unit, 'next> | |
| ReadLine of unit * Continuation<string, 'next> |