Skip to content

Instantly share code, notes, and snippets.

Vladimir Khorikov vkhorikov

Block or report user

Report or block vkhorikov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@theburningmonk
theburningmonk / abstract.txt
Last active Dec 24, 2015
Hack your commit history for fun and profit with F#
View abstract.txt
We programmers spend so much of our time coding everyday, and there's a wealth of information about
HOW we work hidden in our commit histories.
In this talk I'll share some of the ideas we experimented with to analyze our commit history in order
to gain insight into the way we work, and how the quality of our codebase has evolved over time.
Along the way, there were some rather interesting findings!
All the code examples will be in F#, but you can easily apply the same techniques in any other language.
View AsyncResultExtensions.cs
static class AsyncResultExtensions
{
//added to chain awaitable methods
public static async Task<Result<TResult>> OnSuccessAsync<T, TResult>(this Result<T> result, Func<T, Task<Result<TResult>>> func)
{
var res = result;
if (res.Failed)
return Result<TResult>.Fail(res.Error);
return await func(res.Value);
@david-bakin
david-bakin / Result.java
Created Nov 11, 2015
Java Result class - union (sum) type of a success type and a failure type, with a "pattern matching" functional interface
View Result.java
package com.bakins_bits.types;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import com.google.common.base.Preconditions;
You can’t perform that action at this time.