Skip to content

Instantly share code, notes, and snippets.

View anderssonfilip's full-sized avatar

Filip Andersson anderssonfilip

View GitHub Profile
@anderssonfilip
anderssonfilip / Load
Last active December 30, 2015 21:39
Example of using seq{...} to load similar data from tables. To demonstrate difference between synchronous and asynchronous sequences
open Devart.Data
open Devart.Data.Oracle // http://www.devart.com/dotconnect/oracle/download.html
open FSharp.Control // https://github.com/tpetricek/FSharp.AsyncExtensions
open System
open System.Data
let sql = "SELECT * FROM {}"
let tables = [|"t1";"t2";"t3";"t4";"t5";"t6"|]
@anderssonfilip
anderssonfilip / LoadAsync
Created December 10, 2013 10:59
Example of using AsyncSeq{...} to asynchronously load similar data from tables
open Devart.Data
open Devart.Data.Oracle // http://www.devart.com/dotconnect/oracle/download.html
open FSharp.Control // https://github.com/tpetricek/FSharp.AsyncExtensions
open System
open System.Data
let sql = "SELECT * FROM {}"
let tables = [|"t1";"t2";"t3";"t4";"t5";"t6"|]
@anderssonfilip
anderssonfilip / RandomGenerators.sc
Created November 9, 2013 16:30
Random Generators
trait Generator[+T] {
self =>
def generate: T
def map[S](f: T => S): Generator[S] = new Generator[S] {
def generate = f(self.generate)
}
def flatMap[S](f: T => Generator[S]): Generator[S] = new Generator[S] {