[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Disallow empty "or" type specifier
From: |
elf |
Subject: |
Re: [PATCH] Disallow empty "or" type specifier |
Date: |
Tue, 26 Sep 2023 12:33:43 +0300 |
User-agent: |
K-9 Mail for Android |
It certainly shouldn't be *, nor should it be an error... technically an empty
union should be a null set, which would correspond to either a non-extant type
or to no return/value at all...
-elf
On 26 September 2023 12:02:56 GMT+03:00, Pietro Cerutti <gahr@gahr.ch> wrote:
>Hi all,
>
>the attached patch makes the `(or)` type specifier invalid, as opposed to
>being simplified to `*`.
>This is more consistent with the mathematical interpretation of an empty (sum)
>type being the bottom type having no inhabitants.
>This is very explicit in OCaml, for example, where the empty type is literally
>a sum (variant) of 0 types: `type t = |`.
>