This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
let inline tryParse s = | |
let mutable tmp = Unchecked.defaultof<_> | |
if ( ^a : (static member TryParse : string * byref< ^a> -> bool ) (s, &tmp) ) | |
then Some tmp | |
else None | |
let (|Int|_|) s : int option = tryParse s | |
let (|Int64|_|) s : int64 option = tryParse s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Text | |
open Utf8Json | |
[<JsonFormatter(typeof<PointFormatter>)>] | |
type Point = | |
{ Longitude: float | |
Latitude: float } | |
//type Feature = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Net | |
open FSharp.Control.Tasks | |
open Pipelines.Sockets.Unofficial | |
use client = new TcpClient("127.0.0.1", 9851) | |
let pipe = StreamConnection.GetDuplex(client.GetStream()) | |
let scan = Encoding.UTF8.GetBytes "*2\r\n$4\r\nSCAN\r\n$36\r\n85AB427D-316C-4BD4-A511-6631851D212E\r\n" |> ReadOnlyMemory | |
task { | |
let! _ = pipe.Output.WriteAsync(scan) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Collections.Generic | |
open Quotations.Patterns | |
let inline ( ==> ) a b = KeyValuePair(a, b) | |
let isCall = function Call _ -> true | _ -> false | |
let findQuotes q = | |
let rec findQuotes' q res = seq { | |
match q with | |
| Call (_, _, [Lambda (_, Call (_, _, [Call (_, _, [Call (_, _, l)]); next]))] ) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learn more about F# at http://fsharp.org | |
open System | |
open TomlParser.Toml | |
open FParsec | |
[<EntryPoint>] | |
let main argv = | |
let res = | |
run toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Hole() = | |
member _.Add(_, _) = () | |
member _.Add _ = () | |
type CollectionBuilder< ^Collection, 'b, ^Dictionary, 'c | |
when ^Collection : (member Add : 'b -> unit) and ^Collection : (new : unit -> ^Collection) | |
and ^Dictionary : (member Add : 'b * 'c -> unit) and ^Dictionary : (new : unit -> ^Dictionary)>() = | |
member inline _.Combine((x1, y1), (x2, y2)) = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Collections.Generic | |
open System.IO | |
open System.Runtime.CompilerServices | |
open System.Threading | |
open System.Threading.Tasks | |
open FSharp.Control | |
module AsyncEnum = | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#2b3589", | |
"foreground": "#ffffff", | |
// "leading_diamond": "\ue0b6", |