Skip to content

Instantly share code, notes, and snippets.

View akimboyko's full-sized avatar
🙃

Akim Boyko akimboyko

🙃
View GitHub Profile
@akimboyko
akimboyko / quotes.txt
Last active January 5, 2016 13:57 — forked from mausch/gist:8227399
Quotes by Erik Meijer from Reactive programming course
"Hopefully the third answer is right; but who knows, maybe I made a mistake; I’m just a human, I can throw exceptions as well."
"I am waving my hands on purpose here, this is very spaghetti like code. And spaghetti is great as food, but not good as code."
"flatMap will allow us to focus on the happy path. flatMap will take care of all the noise. flatMap is the dolby for programmers."
"Great programmers write baby code"
"it's obviously correct"
public static class EnumerableEx
{
public static IEnumerable<R> Select<T1, T2, R>(this IEnumerable<Tuple<T1, T2>> source, Func<T1, T2, R> f)
{
return source.Select(t => f(t.Item1, t.Item2));
}
}
Enumerable.Range(1, 10)
.Select(x => Tuple.Create(x, x))
@akimboyko
akimboyko / Nat.fs
Created October 19, 2013 05:18 — forked from pirrmann/Nat.fs
//An implementation of basic non-negative integers, based on https://gist.github.com/akimboyko/7019648,
//but rewritten in a more F# idiomatic way
module Naturals
open System
type Natural =
| Zero
| Succ of Natural
member x.IsZero' = x = Zero
using System;
using System.Collections.Generic;
using Autofac;
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Bootstrappers.Autofac;
using Nancy.Hosting.Self;
using Nancy.Routing;
public class Bootstrapper : AutofacNancyBootstrapper