Skip to content

Instantly share code, notes, and snippets.

@dherman
dherman / nans.js
Last active December 15, 2015 11:19
a NaN isn't a NaN isn't a NaN
function bufferBytes(buffer) {
return [].map.call(new Uint8Array(buffer), function(x) {return x})
}
function nanBytes(nan) {
var a = new Float64Array(1);
a[0] = nan;
return bufferBytes(a.buffer);
}
#r @"bin\debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl
open System
open FsControl.Core.Abstractions
// generic semigroup operator
let inline mappend x y = Inline.instance (Monoid.Mappend, x) y
// generic functor operators
let inline fmap f x = Inline.instance (Functor.Fmap, x) f