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 Jakob Wuhrer (16 Nov 2022 19:32 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 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:30 UTC

Lassi Kortela <xxxxxx@lassi.io> writes:
> Union is easier to understand than sum. But for non-mathematicians,
> these names are unfortunately overloaded. In math class we learn that
> a union is the set of all the stuff in the other sets. But in
> programming, the point of a union type is you can pick one choice, not
> all of them. The terminology suggests the opposite of the job that the
> working programmer wants done.
Isn't the union type precisely the type corresponding to the sets that
is the union of the sets corresponding to the types that are parts of
the union?

> I was thinking of something like:
>
> (define person-name-comparator
>   (compare-all
>    (comparator person? person-last-name string-ci-comparator)
>    (comparator person? person-first-name string-ci-comparator)))
>
> (define book-comparator
>   (compare-all
>    (comparator book? book-author person-name-comparator)
>    (comparator book? book-title string-ci-comparator)))
>
> (define cd-comparator
>   (compare-all
>    (comparator cd? cd-artist person-name-comparator)
>    (comparator cd? cd-title string-ci-comparator)))
>
> (define item-comparator
>   (compare-one book-comparator cd-comparator))

I'm personally not a fan of these names

> Also,
>
> (define-record-type CD  ; heh

heh indeed