版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
902 B

  1. "use strict";
  2. /**
  3. * @since 2.11.0
  4. */
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.getMonoid = exports.getSemigroup = exports.URI = void 0;
  7. var function_1 = require("./function");
  8. /**
  9. * @category type lambdas
  10. * @since 2.11.0
  11. */
  12. exports.URI = 'Endomorphism';
  13. /**
  14. * Endomorphism form a `Semigroup` where the `concat` operation is the usual function composition.
  15. *
  16. * @category instances
  17. * @since 2.11.0
  18. */
  19. var getSemigroup = function () { return ({
  20. concat: function (first, second) { return (0, function_1.flow)(first, second); }
  21. }); };
  22. exports.getSemigroup = getSemigroup;
  23. /**
  24. * Endomorphism form a `Monoid` where the `empty` value is the `identity` function.
  25. *
  26. * @category instances
  27. * @since 2.11.0
  28. */
  29. var getMonoid = function () { return ({
  30. concat: (0, exports.getSemigroup)().concat,
  31. empty: function_1.identity
  32. }); };
  33. exports.getMonoid = getMonoid;