版博士V2.0程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

29 linhas
674 B

  1. /**
  2. * @since 2.11.0
  3. */
  4. import { flow, identity } from './function';
  5. /**
  6. * @category type lambdas
  7. * @since 2.11.0
  8. */
  9. export var URI = 'Endomorphism';
  10. /**
  11. * Endomorphism form a `Semigroup` where the `concat` operation is the usual function composition.
  12. *
  13. * @category instances
  14. * @since 2.11.0
  15. */
  16. export var getSemigroup = function () { return ({
  17. concat: function (first, second) { return flow(first, second); }
  18. }); };
  19. /**
  20. * Endomorphism form a `Monoid` where the `empty` value is the `identity` function.
  21. *
  22. * @category instances
  23. * @since 2.11.0
  24. */
  25. export var getMonoid = function () { return ({
  26. concat: getSemigroup().concat,
  27. empty: identity
  28. }); };