Skip to content

Instantly share code, notes, and snippets.

View mperry's full-sized avatar

Mark Perry mperry

View GitHub Profile
@davidallsopp
davidallsopp / PropertyTests.scala
Last active September 16, 2020 14:07
Examples of writing mixed unit/property-based (ScalaTest with ScalaCheck) tests. Includes tables and generators as well as 'traditional' tests.
/**
* Examples of writing mixed unit/property-based (ScalaCheck) tests.
*
* Includes tables and generators as well as 'traditional' tests.
*
* @see http://www.scalatest.org/user_guide/selecting_a_style
* @see http://www.scalatest.org/user_guide/property_based_testing
*/
import org.scalatest._
@timyates
timyates / YCombinatorFactorial.java
Last active August 29, 2015 14:00
Y Combinator based factorial in Java 8
package test;
import java.math.BigInteger;
import java.util.function.Function;
public class YCombinatorFactorial<T> {
private interface Improver<T> {
Function<T,T> apply( Improver<T> f ) ;
}
@pchiusano
pchiusano / Process.hs
Created February 2, 2013 02:03
Stream transducer library
{-# Language ExistentialQuantification, GADTs #-}
module Control.Process where
import Data.Monoid
import Prelude hiding (zip, zipWith)
import Control.Applicative
import System.IO
data Process f a = Halt