Sketch for a JavaScript pattern matching library