Last call for comments on SRFI 228: Composing Comparators Arthur A. Gleckler (15 Nov 2022 21:03 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 12:17 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 12:34 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (16 Nov 2022 12:53 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 13:18 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 18:44 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 19:18 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 17:34 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Jakob Wuhrer (16 Nov 2022 19:28 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (18 Nov 2022 19:06 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (23 Nov 2022 10:10 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (26 Nov 2022 10:54 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (26 Nov 2022 11:22 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Arthur A. Gleckler (23 Nov 2022 19:43 UTC)

Re: Last call for comments on SRFI 228: Composing Comparators Jakob Wuhrer 16 Nov 2022 19:23 UTC


Shiro Kawai <xxxxxx@gmail.com> writes:
> But can you define a reasonable base case E ≡
> (make-product-comparator) such that (make-product-comparator X) ≡
> (make-product-comparator E X) ?

Yes, there are comparators that take the role of "zero" and "one", with
respect to the sum and product comparators, respectively.

If I'm not mistaken, those can be implemented as:

#+begin_src scheme
(define comparator-one
  (make-comparator (const #t)
                   (const #t)
                   (const #f)
                   (const 0)))

(define comparator-zero
  (make-comparator (const #f)
                   (const #f)
                   (const #t)
                   (const 0)))
#+end_src

I think it may be worthwile to export these as variables.

If I'm not mistaken, the set of all comparators together with sum,
product, zero, and one, has a semiring structure.