Skip to content

Instantly share code, notes, and snippets.

@nojaf
nojaf / CE.fs
Created January 12, 2024 13:08
module CE
type DummyBuilder() =
member this.Zero() = List.empty
member this.Delay(f) = f ()
member this.Yield(x: int) = List.singleton (x + 1)
member this.YieldFrom(x: int list) = x
member this.Combine(a, b) = a @ b
let dummy = DummyBuilder()
@nojaf
nojaf / Plugin.fs
Created September 18, 2024 13:16
Fable React JSX Plugin
namespace React.Plugin
open System
open System.IO
open Fable
open Fable.AST
open Fable.AST.Fable
// Tell Fable to scan for plugins in this assembly
[<assembly : ScanForPlugins>]
import { readdir, stat as statAsync } from "fs/promises";
import { join } from "path";
// benchmark.js
const start = process.hrtime.bigint();
// --- your code goes here ---
const args = process.argv.slice(2);
if (args.length === 0) {