Welcome to the forums and thank you for this contribution! This is quite a way to show and present oneself ^^
I have a small question… How does the assembly/performance look like when compared to non-typed (Result, Option, etc) types? I assume that if the library is nicely written, these types and their functions most likely just require a tiny bit of extra memory and maybe a couple more ifs?
Also, I assume this does not rely on any runtime and could therefore potentially be used in embedded systems?
I found this one disappointing.
For what you have (a generic, with a non-discriminated private type parameter), it would have been easier to use unconstrained arrays:
Type Index is Boolean True..True;
Type Optional is Array (Index range <>) of Element;
None : Constant Optional( True..False ) := (Others => <>);
Function "+"( Object : Element ) return Optional is
( Optional'(True => Object) );
Also, with this form you can use:
Procedure Do_Something( Parameter : Optional ) is
Begin
--…
For X of Parameter loop
--Stuff operating on the element, if any, here.
End loop;
End;