guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#60802] [PATCH v3 1/2] platforms: Raise an exception when no suitabl


From: Simon Tournier
Subject: [bug#60802] [PATCH v3 1/2] platforms: Raise an exception when no suitable platform is found.
Date: Mon, 16 Jan 2023 12:00:20 +0100

Hi Josselin,

On dim., 15 janv. 2023 at 14:57, Josselin Poiret via Guix-patches via 
<guix-patches@gnu.org> wrote:

> This looks good to me, although in the grand scheme of things I wonder
> if that change is a step forward: for those kinds of procedures, we
> could expect consumers to instead always properly handle the #f case
> themselves, rather than baby-sitting them and systematically relying on
> exceptions in the parent procedure, no?  As a caricatural example: the
> SRFI-1 `find` could raise an exception instead of returning #f, but I
> don't think anyone would consider that proper behaviour.

How to handle, is it not somehow a convention?  Using the example
’find’, we could imagine it returns an exception ’not-found’ instead of
the current plain #f – this #f appears to me a convention, no?  Or
’find’ could return some Maybe monad (’Just the-result’ or None) –
another convention.

Well, how to handle appears to me a convention when composing. :-)


Cheers,
simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]