mezzanine
Version:
Fantasy land union types with pattern matching
17 lines (13 loc) • 374 B
JavaScript
import Type from '../type';
var Tuple = (...types) => Type`Tuple${types.length}`(types, {
length: () => types.length,
[Symbol.iterator](ctx) {
return function* () {
var length = ctx.length;
for (var i = 0; i < length; i++) {
yield ctx[i];}
};
} }).
contramap((...types) => types);
export default Tuple;
//# sourceMappingURL=tuple.js.map