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
(* | |
Towards verifying message-passing protocols. | |
Protocol typically involves two parties, let us call Client and Server, | |
a number of states and state transitions involving passing of messages. | |
Client has agency - non-deterministic process in process calculi. | |
Server is deterministic, but it should handle all possible clients. | |
Ideally, we would take a DSL for the protocol, and spit out F# code that |
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.Net | |
open Microsoft.FSharp.Control.WebExtensions | |
open System.Diagnostics | |
open System | |
let fetch name (url:string) = | |
printfn "fetching %s" name | |
let uri = new System.Uri(url) | |
use webClient = new WebClient() | |
let stopwatch = Stopwatch() |
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
/** | |
* Executes a transducer to transform the observable sequence | |
* @param {Transducer} transducer A transducer to execute | |
* @returns {Observable} An Observable sequence containing the results from the transducer. | |
*/ | |
observableProto.transduce = function(transducer) { | |
var source = this; | |
function transformForObserver(observer) { | |
return { |
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
module Monad = | |
type M<'T,'B when 'B :> Sig<'B>> = | |
interface end | |
and Sig<'B when 'B :> Sig<'B>> = | |
abstract member Return<'X> : 'X -> M<'X,'B> | |
abstract member Bind<'X,'Y> : | |
M<'X,'B> -> ('X -> M<'Y,'B>) -> M<'Y,'B> |
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
#if INTERACTIVE | |
#r "Microsoft.CSharp.dll" | |
#endif | |
open System | |
open System.Dynamic | |
open System.Linq.Expressions | |
open System.Reflection | |
open System.Runtime.CompilerServices | |
open Microsoft.CSharp.RuntimeBinder |
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
load_assembly 'System.Core' | |
load_assembly 'System.CoreEx, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
load_assembly 'System.Reactive, Version=1.0.2521.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35' | |
using_clr_extensions System | |
using_clr_extensions System::Linq | |
include System | |
include System::Linq |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'yaml' | |
require 'cgi' | |
require 'bossman' | |
include BOSSMan | |
require 'igraph' |
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
// Func<IRequest, IResponse> | |
public interface IApplication { | |
IAsyncResult BeginInvoke(IRequest request, AsyncCallback callback, object state); | |
IResponse EndInvoke(IAsyncResult result); | |
} |
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
namespace Owin | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.IO; | |
public interface IResponseHandler | |
{ | |
Type TypeToHandle { get; } |
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
public Result App1(IDictionary<string, object> env) { | |
var request = new Request(env); | |
request.Logger.Info("Calling " + request.ScriptName); | |
return new Result( | |
200, | |
new Dictionary<string, object>{{"Content-Type","text/plain"}}, | |
new[]{"<p>You are looking at", request.ScriptName, "</p>"}); | |
} |
OlderNewer