var adt;
try {
  adt = require("adt");
} catch (e) {
  adt = null;
}

// Given an object and a class name, tries to determin if the object is an
// instance of said class.
function matchesTypeName (obj, name) {
  if (adt && isADT(obj)) {
    var types = adt.lookup(name);
    if (types) {
      for (var i = 0, len = types.length; i < len; i++) {
        if (obj instanceof types[i]) return true;
      }
    }
    return false;
  }

  if (obj.constructor && obj.constructor.name && obj.constructor.name === name) {
    return true;
  }

  return false;
}

// Checks whether an object is an adt.js type.
function isADT (obj) {
  return obj instanceof adt.__Base__;
}

// Export
module.exports = {
  matchesTypeName: matchesTypeName,
  isADT: isADT
};

@@ -209,16 +209,308 @@
  %7B%0A  if 
+(name === %22Number%22) %7B%0A    return typeof obj === %22number%22;%0A  %7D%0A%0A  else if (name === %22String%22) %7B%0A    return typeof obj === %22string%22;%0A  %7D%0A%0A  else if (name === %22Function%22) %7B%0A    return obj instanceof Function;%0A  %7D%0A%0A  else if (name === %22Object%22) %7B%0A    return obj instanceof Object;%0A  %7D%0A%0A  else if 
 (adt && 
@@ -519,24 +519,24 @@
 ADT(obj)) %7B%0A
-
     var type
@@ -692,24 +692,24 @@
     %7D%0A    %7D%0A
+
     return f
@@ -723,112 +723,8 @@
  %7D%0A%0A
-  if (obj.constructor && obj.constructor.name && obj.constructor.name === name) %7B%0A    return true;%0A  %7D%0A%0A
   re

Remove checking of constructor.name, instead just check primitive types and adt.js types