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.IO | |
open System.Web | |
open System.Net | |
open System.Collections.Generic | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
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.IO | |
let find_files dir = Directory.GetFiles( dir, "*.fs?", SearchOption.AllDirectories ) | |
let not_start (s:string) p = not <| s.StartsWith p | |
let has_type (s:string) = if s.Contains @"type" then 1 else 0 | |
let has_module (s:string) = if s.Contains @"module" then 1 else 0 | |
let has_binding (s:string) = if s.Contains @"let" || | |
s.Contains @"member" then 1 else 0 |
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.Diagnostics | |
open System.Reflection | |
open Microsoft.FSharp.Core | |
open Microsoft.FSharp.Core.Operators | |
open Microsoft.FSharp.Core.LanguagePrimitives | |
open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators | |
open Microsoft.FSharp.Collections | |
open Microsoft.FSharp.Primitives.Basics | |
open System.Collections.Generic |
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
#r "../../../packages/fparsec/lib/net40-client/fparseccs.dll" | |
#r "../../../packages/fparsec/lib/net40-client/fparsec.dll" | |
open System | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
open FParsec | |
open FParsec.Primitives | |
let (^) = (<|) |
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.Reflection | |
type CLIArguments = | |
| Working_Directory of string | |
| Listener of host:string * port:int | |
| Data of byte [] | |
| Port of int | |
| Log_Level of int | |
| Detach |
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
let construct_toml (toplevel:(string*Value)list, | |
tables:(string*(string*Value)list)[]) = | |
let addSection (table:Dictionary<string,Value>) (kvps:(string*Value) list) = | |
kvps |> List.iter (fun (k,v)-> table.Add( keyName k,v )) | |
let foldtoml (prev:string, nested:string list, acc:Dictionary<string,Value>,toml:Dictionary<string,Value>) | |
(cur:string, elems:(string*Value)list) = | |
try | |
(* add parsed elements to current table *) |
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.Reflection | |
open System.Reflection.Emit | |
open System.Runtime.InteropServices | |
open System | |
[<AutoOpen>] | |
module ByteUtils = | |
type Bit = | |
| One |
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
(* | |
Heterogeneous Parallel Async Composition Operator | |
- an evolution of http://jackfoxy.com/transparent-heterogeneous-parallel-async-with-fsharp/ | |
*) | |
type 'T Parallel = | |
private { | |
Compute : obj Async [] | |
Unpack : obj [] -> int -> 'T | |
} |
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
(*=============================== | |
|| || | |
|| QuickStart || | |
|| || | |
===============================*) | |
// A simple example of a property definition is | |
let prop_RevRev xs = List.rev(List.rev xs) = xs |
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 | |
type message = string | |
let logEvent = Event<message> () | |
let logStream, post = logEvent.Publish, logEvent.Trigger | |
logStream.Add <| printf "%s | " | |
let dispose (d:#IDisposable) = d.Dispose() |