I hereby claim:
- I am lamg on github.
- I am lamg (https://keybase.io/lamg) on keybase.
- I have a public key whose fingerprint is A1C2 E5BE EA42 B2B9 1A8A 0D80 3941 99B7 9F03 6583
To claim this, I am signing this object:
#r "nuget: Microsoft.Data.Sqlite" | |
#r "nuget: Oxpecker" | |
#r "nuget: FSharp.Control.TaskSeq" | |
open Microsoft.Data.Sqlite | |
open FSharp.Control | |
open System.Threading.Tasks | |
type User = { id: int64; name: string } |
// vertices are implicit in the set of values of type 'a | |
type Graph<'a when 'a: comparison> = { edges: Set<'a * 'a> } | |
let adjacent (g: Graph<'a>) (x: 'a) = | |
g.edges |> Set.filter (fun (y, _) -> x = y) |> Set.map snd | |
let graphLevels (startVertex: 'a) (g: Graph<'a>) = | |
let rec subLevels (level: Set<'a>, visited: Set<'a>) = | |
match level with | |
| _ when level.IsEmpty -> [] |
type Tree<'a> = { value: 'a; children: Tree<'a> list } | |
let rec levels (ts: Tree<'a> list) = | |
match ts with | |
| [] -> [] | |
| _ -> | |
let xs, chls = ts |> List.map (fun t -> t.value, t.children) |> List.unzip | |
let subs = chls |> List.concat |> levels | |
xs :: subs |
#r "nuget: ObjectDumper.NET, 4.3.4-pre" | |
let greenFragment x = | |
let ansiGreen = "\x1b[32m" | |
let ansiReset = "\x1b[0m" | |
$"%s{ansiGreen}%s{x}%s{ansiReset}" | |
let redFragment x = | |
let ansiRed = "\x1b[31m" | |
let ansiReset = "\x1b[0m" |
type Branch<'a, 'b> = | |
{ value: 'a | |
children: Tree<'a, 'b> seq } | |
and Tree<'a, 'b> = | |
| Branch of Branch<'a, 'b> | |
| Leaf of 'b | |
type PrinterContext<'a, 'b> = | |
abstract member branchToString: 'a -> string |
#r "nuget: GirCore.Gtk-4.0,0.5.0" | |
open System | |
open Gtk | |
let label () = | |
let label = new Label() | |
label.SetText "hello" | |
label |
use std::cmp::PartialEq; | |
fn is_perm<T: PartialEq>(xs: &Vec<T>, ys: &Vec<T>) -> bool { | |
let mut ok = xs.len() == ys.len(); | |
let mut ws: Vec<&T> = xs.iter().collect(); | |
let mut zs: Vec<&T> = ys.iter().collect(); | |
while ok && ws.len() != 0 { | |
let (ok0, i) = exists(&zs, &ws[0]); | |
ok = ok0; | |
if ok0 { |
package main | |
import ( | |
"testing" | |
"github.com/stretchr/testify/require" | |
) | |
func TestIsPerm(t *testing.T) { | |
ts := []struct { | |
xs, ys []string |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
gp "github.com/elazarl/goproxy" | |
"log" | |
"net" | |
"net/http" |
I hereby claim:
To claim this, I am signing this object: