code: function typeVarConstraintViolation(
      env,            // :: Array Type
      typeInfo,       // :: TypeInfo
      index,          // :: Integer
      propPath,       // :: PropPath
      valuesByPath    // :: StrMap (Array Any)
    ) {
      //  If we apply an ‘a -> a -> a -> a’ function to Left ('x'), Right (1),
      //  and Right (null) we'd like to avoid underlining the first argument
      //  position, since Left ('x') is compatible with the other ‘a’ values.
      var key = JSON.stringify (Z.concat ([index], propPath));
      var values = valuesByPath[key];
  
      //  Note: Sorting these keys lexicographically is not "correct", but it
      //  does the right thing for indexes less than 10.
      var keys = Z.filter (function(k) {
        var values_ = valuesByPath[k];
        return (
          //  Keep X, the position at which the violation was observed.
          k === key ||
          //  Keep positions whose values are incompatible with the values at X.
          isEmpty (determineActualTypesStrict (env, Z.concat (values, values_)))
        );
      }, sortedKeys (valuesByPath));
  
      var underlinedTypeVars =
      underlineTypeVars (typeInfo,
                         Z.reduce (function($valuesByPath, k) {
                           $valuesByPath[k] = valuesByPath[k];
                           return $valuesByPath;
                         }, {}, keys));
  
      return new TypeError (trimTrailingSpaces (
        'Type-variable constraint violation\n\n' +
        underlinedTypeVars + '\n' +
        (Z.reduce (function(st, k) {
          var values = valuesByPath[k];
          return isEmpty (values) ? st : {
            idx: st.idx + 1,
            s: st.s +
               showValuesAndTypes (env, typeInfo, values, st.idx + 1) +
               '\n\n'
          };
        }, {idx: 0, s: ''}, keys)).s +
        'Since there is no type of which all the above values are ' +
        'members, the type-variable constraint has been violated.\n'
      ));
    }
docs: typeVarConstraintViolation :: ... -> Error