Skip to content

Instantly share code, notes, and snippets.

View gregnwosu's full-sized avatar

Gregory Nwosu gregnwosu

View GitHub Profile
object Exercise8 {
def main(args: Array[String]):Unit = {
Prop.run(maxProp)
}
def listOfGen[A](g: Gen[A]): Gen[List[A]] = Gen(sequence (List.fill(100)(g.sample)))
#!/bin/bash -e
bindir=`pwd`/bin-tmp
mkdir -p $bindir
export PATH=$bindir:$PATH
function use_ld() {
rm -f $bindir/ld
ln -s $1 $bindir/ld
echo "Using $1 for ld"
}
package nl.mdj.fpinscala
import akka.actor.Actor.Receive
import akka.actor.{Props, Actor, ActorSystem, ActorRef}
import akka.pattern.ask
import akka.util.Timeout
import nl.mdj.fpinscala.KeyValueStore.ListKeys
import scala.concurrent.{Await, Future}
import scala.concurrent.duration._
import scalaz._
@gregnwosu
gregnwosu / System Design.md
Created April 20, 2016 09:14 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@gregnwosu
gregnwosu / ChapterExercises.hs
Last active July 20, 2016 14:33
why doesnt my traversable pass its tests
module ChapterExercises where
import Data.Monoid ((<>))
data List a =
Nil | Cons a (List a) deriving (Eq, Show, Ord)
instance Functor List where
fmap _ Nil = Nil
fmap f (Cons a l) = Cons (f a) (f<$>l)
### Keybase proof
I hereby claim:
* I am gregnwosu on github.
* I am gregnwosu (https://keybase.io/gregnwosu) on keybase.
* I have a public key whose fingerprint is 7E82 0848 D961 8907 487D 48B2 884D C0AF C389 330B
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am gregnwosu on github.
  • I am gregnwosu (https://keybase.io/gregnwosu) on keybase.
  • I have a public key whose fingerprint is 7E82 0848 D961 8907 487D 48B2 884D C0AF C389 330B

To claim this, I am signing this object:

@gregnwosu
gregnwosu / main.hs
Created November 1, 2016 20:45
sequence slower to index?
module SequenceTest where
import Criterion.Main
import qualified Data.Sequence as SQ
s :: SQ.Seq Int
s = SQ.fromList [1..9100]
lists :: [[Int]]
lists = replicate 10 [1..1000000]
seqs :: [SQ.Seq Int]
FAILURE: Build failed with an exception.
* What went wrong:
Problem configuring task :run from command line.
> Unknown command-line option '--init'.
* Try:
Run gradlew help --task :run to get task usage details. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is: