Maybe macros John Cowan (26 Jun 2020 17:16 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (26 Jun 2020 17:43 UTC)
Re: Maybe macros John Cowan (26 Jun 2020 18:48 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (26 Jun 2020 18:57 UTC)
Re: Maybe macros John Cowan (27 Jun 2020 04:29 UTC)
Re: Maybe macros Arthur A. Gleckler (26 Jun 2020 19:50 UTC)
Re: Maybe macros John Cowan (26 Jun 2020 19:52 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (27 Jun 2020 03:44 UTC)
Re: Maybe macros Arthur A. Gleckler (27 Jun 2020 03:59 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (27 Jun 2020 04:15 UTC)
Re: Maybe macros Arthur A. Gleckler (27 Jun 2020 04:29 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (27 Jun 2020 14:09 UTC)
Re: Maybe macros John Cowan (27 Jun 2020 18:55 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (27 Jun 2020 20:46 UTC)
Re: Maybe macros John Cowan (27 Jun 2020 21:34 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (28 Jun 2020 17:26 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (28 Jun 2020 17:43 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (28 Jun 2020 18:52 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (28 Jun 2020 20:24 UTC)
Re: Maybe macros John Cowan (28 Jun 2020 18:54 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (28 Jun 2020 20:21 UTC)
Re: Maybe macros Alex Shinn (29 Jun 2020 00:02 UTC)
Re: Maybe macros Marc Nieper-Wißkirchen (29 Jun 2020 06:23 UTC)
Re: Maybe macros Wolfgang Corcoran-Mathe (28 Jun 2020 16:54 UTC)

Re: Maybe macros Wolfgang Corcoran-Mathe 28 Jun 2020 17:26 UTC

On 2020-06-27 22:46 +0200, Marc Nieper-Wißkirchen wrote:
> I have to think of how much `-and' and `-or' without any argument make
> sense logically. In any case, the payload of the Just/Right or the
> Left would have nothing to do with truth or the falsehood of the
> `-and' or `-or' form. So wrapping `#t' or `#f' is definitely not "the
> right thing".

This seems like the stickiest point to get right with these forms.
I'd tentatively suggest the following.  If no expressions are passed
to the maybe/either -and/-or forms,

* maybe-or returns Nothing

* maybe-and returns a Just whose payload is a single unspecified value

* either-or returns a Left whose payload is a single unspecified value

* either-and returns a Right whose payload is a single unspecified value

For the last three forms: I find the container-of-no-values solution
elegant, but I think single-valued containers are much easier to
deal with (as John also notes).  The unit of the operations are,
respectively, any Just/Left/Right, so it makes sense to me that we
leave the payload unspecified.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>

"Earth is the cradle of the mind, but one cannot live in a
cradle forever." --Konstantin Tsiolkovsky