     for [p, e] in underscore.zip(pattern, node)
       matchNode(p, e, match)
 
-  # TODO: ok if node instanceof pattern
+  else if node instanceof pattern
+    return yes
+
   # TODO: `Several` for mapping pattern matching over array
 
   else

class MatchCapture extends Base
  constructor: (@name, @subpattern) ->
  toString: -> "M(#{@name})"
exports.M = M = (name) -> new MatchCapture(name)

class AnyMatch extends Base
  toString: -> " any"
exports.any = any = new AnyMatch

#### utilities


# Pattern matching utilities
matchNode = (pattern, node, match) ->
  if pattern instanceof MatchCapture
    match[pattern.name] = node
    matchNode(pattern.subpattern, node, match) if pattern.subpattern

  else if pattern instanceof AnyMatch
    return yes

  else if pattern instanceof Base
    throw "match failed" unless node instanceof pattern.constructor
