I hereby claim:
- I am jedahu on github.
- I am jedahu (https://keybase.io/jedahu) on keybase.
- I have a public key ASAEDZtMXX9XenWwUEArDrIcIWeR7Zpc2RIfw-UPq5ILjgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
macro $enum { | |
case $name:ident {$val:ident (,) ...} => { | |
var $name = {$($val: null) (,) ...}; | |
for (var k in $name) { | |
$name[k] = k; | |
} | |
Object.freeze($name); | |
} | |
} |
using System.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Linq; | |
[ContractClass(typeof(IValidatorContract<,>))] | |
public interface IValidator<E, in A> | |
{ | |
IEnumerable<E> Validate(A a); | |
} |
package gettyped | |
sealed abstract class Maybe[A] { | |
def fold[B](nothing: => B, just: A => B): B = this match { | |
case Nothing() => nothing | |
case Just(a) => just(a) | |
} | |
} | |
private final case class Nothing[A]() extends Maybe[A] {} |
Create an executable (recapture
) that plays a signal through 24 audio ports and simultaneously records from another 24 ports. These ports come from three daisy chained Presonus FP10’s connected by firewire to a linux box. This hardware is accessed by the ffado jack drivers.
function ngIt($injector) { | |
return function(text, fn) { | |
it(text, function(done) { | |
var $rootScope = $injector.get('$rootScope') | |
, fin | |
, finished = function(err) { | |
fin = true; | |
done(err); | |
}; | |
fn(finished); |
#!/bin/sh | |
git diff-index --check --cached $against -- && \ | |
rm -rf out && \ | |
git stash save --keep-index 'pre-commit unstaged changes' && \ | |
lein clojurescript fresh test && \ | |
git stash pop |
#!/bin/sh | |
PORT=9000 | |
OUT_DIR='out' | |
while getopts ":f:p:d:" opt; do | |
case $opt in | |
f) | |
HTML="$OPTARG" | |
;; |
The type class encoding in my previous post on the subject is a bit rubbish:
The Maybe
type I described could do with some type class instances, so
let’s try out a new encoding.