Release 2.0.0
⚠️ BREAKING CHANGES
- Try Module API Redesign: Complete refactoring of exception handling
Changed
- Try Module: Redesigned for maximum flexibility
- Renamed
Functional.Try.To_Result→Functional.Try.Try_To_Result - Renamed
Functional.Try.To_Option→Functional.Try.Try_To_Functional_Option - Added
Functional.Try.Try_To_Functional_Result(convenience for Functional.Result) Try_To_Resultnow works with any Result type (domain-specific, custom implementations)- Consolidated all Try functions into single
Functional.Trypackage - Removed child packages
Functional.Try.To_ResultandFunctional.Try.To_Option - Generic parameters allow bridging to any Result implementation with custom
Ok/Errconstructors
- Renamed
Added
- Generic
Try_To_Resultsupports custom Result types with configurable constructors - Example code showing usage at infrastructure boundaries
- Comprehensive documentation for Try pattern in README
Migration Guide (1.0.0 → 2.0.0)
Old Code (1.0.0):
with Functional.Try.To_Result;
with Functional.Try.To_Option;
function Try_Read is new Functional.Try.To_Result (...);
function Try_Parse is new Functional.Try.To_Option (...);New Code (2.0.0):
with Functional.Try;
-- For custom domain Result types:
function Try_Read is new Functional.Try.Try_To_Result
(T => Integer_32, E => Error_Type,
Result_Type => Domain_Result.Result,
Ok => Domain_Result.Ok,
Err => Domain_Result.From_Error,
Map_Exception => From_Exception,
Action => Raw_Read);
-- For Functional.Result:
function Try_Parse is new Functional.Try.Try_To_Functional_Result
(T => String, E => Error,
Result_Pkg => Str_Result,
Map_Exception => From_Exception,
Action => Raw_Parse);
-- For Functional.Option:
function Try_Lookup is new Functional.Try.Try_To_Functional_Option
(T => Integer,
Option_Pkg => Int_Option,
Action => Raw_Lookup);