Let's say you have implemented a small data pipeline library to replace LINQ.
module TrivialStream =
type Receiver<'T> = 'T -> unit
type Stream<'T> = Receiver<'T> -> unit
module Details =
// This is am example of an immediate write / random access cursor for Excel with basic formatting options. | |
// Implementation is based on a concrete, non generic writer monad with no payload ("do!"" only) (only state). | |
// Instead of directl writing to excel, an alternatives would be a random acces to a | |
// copy-on-write list (or even a mutable array) and then bulk-write the result to excel in one shot. | |
// When only forward access would have been required, a simple seq expression with yields would have been enough. | |
// Anyway, it is a demonstration on how to "hide" pseudo-mutable state that is passed through a computation. | |
// | |
// I personally use it for generating reports based on various data sources. |
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 |
(* | |
Simulation of the Lorentz attractor, using Fable. | |
If you want to see this code in action, just copy this code into the Fable REPL: | |
https://fable.io/repl/ | |
*) | |
module App | |
open Elmish | |
open Elmish.React |
// ts2fable 0.0.0 | |
namespace rec Fable.Three | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
open Fable.Import.Browser | |
module Three = | |
open System | |
open System.IO | |
open System.Diagnostics | |
let downloadDependencies deps = | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
if not (File.Exists "paket.exe") then | |
async { | |
let url = "http://fsprojects.github.io/Paket/stable" |
namespace GhFsharpTest | |
open Grasshopper.Kernel | |
open Grasshopper.Kernel.Types | |
type Priority() = | |
inherit GH_AssemblyPriority() | |
override u.PriorityLoad() = | |
GH_LoadingInstruction.Proceed |
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:
/// <summary> | |
/// Extract all family type properties data | |
/// </summary> | |
/// <param name="app"></param> | |
private MultiValueDictionary<string, Tuple<string, string>> ExtractFamilyParameterInfo(Application app) | |
{ | |
//Open Revit Family File in a separate document | |
var doc = app.OpenDocumentFile(FamilyPath); |
#I __SOURCE_DIRECTORY__ | |
#r "libs/NuGet.Core.dll" | |
#r "System.Xml.Linq" | |
open NuGet | |
open System | |
open System.IO | |
module NuGet = |