Skip to content

Instantly share code, notes, and snippets.

@mathias-brandewinder
mathias-brandewinder / graph.fsx
Created April 11, 2017 21:43
Visualize Azure Function App with F# and GraphViz
(*
Reading out bindings
*)
type Direction =
| Trigger
| In
| Out
type Properties = Map<string,string>
@praeclarum
praeclarum / AlgorithmW.fs
Last active March 19, 2024 17:44
Algorithm W - or Hindley-Milner polymorphic type inference - in F#
module AlgorithmW
// HINDLEY-MILNER TYPE INFERENCE
// Based on http://catamorph.de/documents/AlgorithmW.pdf
// (Now at http://web.archive.org/web/20170704013532/http://catamorph.de/documents/AlgorithmW.pdf)
type Lit =
| LInt of int
| LBool of bool
@isaacabraham
isaacabraham / suave-on-service-fabric.fs
Last active January 6, 2017 15:04
Hosting Suave in Azure Service Fabric
open Microsoft.ServiceFabric.Services
open Suave
open Suave.Http.Successful
open Suave.Web
open System.Fabric
open System.Threading
open System.Threading.Tasks
type SuaveService() =
inherit StatelessService()
@akimboyko
akimboyko / 01_SayHello.fsx
Last active May 28, 2023 13:00
Samples from "Actor-based Concurrency with F# and Akka.NET" http://bit.ly/FSharpAkkaNET
#time "on"
#load "Bootstrap.fsx"
open System
open Akka.Actor
open Akka.Configuration
open Akka.FSharp
open Akka.TestKit
// #Using Actor
@eulerfx
eulerfx / AsyncSeqVsScalaz-stream.md
Last active March 4, 2016 21:48
Informal proof that F# AsyncSeq is equal in expressive power to scalaz-stream Process when specialized to Task

There is a great purely functional streaming/IO library in Scala called scalaz-stream. It is itself based upon a Haskell library called machines. They provide powerful abstractions to express compositional effectful computations. These libraries rely on certain type system features in both Scala and Haskell which are unavailable in F# - namely existential types and higher kinds. Higher kinds allow the monad representing the side-effects to be abstracted over. If however we specialize this to a specific monad, we can get around the lack of existentials as well.

Tomas Petricek created a type called asynchronous sequence which provides similar capabilities. The F# AsyncSeq type is declared as follows:

type AsyncSeq<'a> = Async<AsyncSeqInner<'a>>

and AsyncSeqInner<'a> = 
    | Nil
 | Cons of 'a * AsyncSeq&lt;'a&gt;
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@ovatsus
ovatsus / Setup.fsx
Created March 17, 2012 17:07
Script to setup F# Interactive session, loading everything in the current solution
#r "System.Xml.Linq"
open System
open System.IO
open System.Xml.Linq
let script = seq {
//TODO: this currently loads fsproj's in alphabeticall order, we should instead
//build the dependencies graph of the fsproj's and load them in topological sort order