版博士V2.0程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

36 líneas
1.3 KiB

  1. /**
  2. * The `Semiring` class is for types that support an addition and multiplication operation.
  3. *
  4. * Instances must satisfy the following laws:
  5. *
  6. * - Commutative monoid under addition:
  7. * - Associativity: `(a + b) + c <-> a + (b + c)`
  8. * - Identity: `zero + a = a + zero <-> a`
  9. * - Commutative: `a + b <-> b + a`
  10. * - Monoid under multiplication:
  11. * - Associativity: `(a * b) * c <-> a * (b * c)`
  12. * - Identity: `one * a <-> a * one <-> a`
  13. * - Multiplication distributes over addition:
  14. * - Left distributivity: `a * (b + c) <-> (a * b) + (a * c)`
  15. * - Right distributivity: `(a + b) * c <-> (a * c) + (b * c)`
  16. * - Annihilation: `zero * a <-> a * zero <-> zero`
  17. *
  18. * **Note:** The `number` type is not fully law abiding members of this class hierarchy due to the potential
  19. * for arithmetic overflows, and the presence of `NaN` and `Infinity` values. The behaviour is
  20. * unspecified in these cases.
  21. *
  22. * @since 2.0.0
  23. */
  24. import { getSemiring } from './function';
  25. // -------------------------------------------------------------------------------------
  26. // deprecated
  27. // -------------------------------------------------------------------------------------
  28. /**
  29. * Use [`getSemiring`](./function.ts.html#getsemiring) instead.
  30. *
  31. * @category zone of death
  32. * @since 2.0.0
  33. * @deprecated
  34. */
  35. export var getFunctionSemiring = getSemiring;