Or TACkLe. Or Tomek's Ada Class Library. Everything I find useful and I think should be a part of the (extended) standard library.
This is alpha software. I'm actively working it. YMMV.
In the future, I may split it into multiple libraries.
Tested on Linux x86_64, MacOS ARM and Windows x86_64.
The best is to use it with tada. Tada doesn't support dependencies yet, so, actually, the best way is to clone the code and use the provided tackle.gpr.
For now, it provides these packages:
-
Tackle.Results- genericResulttype.SuccessandFailure. For now, read the package spec. Example:with Ada.Text_IO; with Tackle.Results; procedure Demo is use Ada; type Math_Error is (Division_By_Zero); package Float_Results is new Tackle.Results (Value_Type => Float, Error_Type => Math_Error); use Float_Results; function Divide (A, B : Float) return Result is begin if B = 0.0 then return Failure (Division_By_Zero); end if; return Success (A / B); end Divide; procedure Print_Result (Label : String; R : Result) is begin Text_IO.Put (Label & ": "); case R.Status is when Success => Text_IO.Put_Line (R.Value'Image); when Failure => Text_IO.Put_Line ("error: " & R.Error'Image); end case; end Print_Result; begin Print_Result ("10.0 / 4.0", Divide (10.0, 4.0)); Print_Result (" 1.0 / 0.0", Divide (1.0, 0.0)); end Demo;
-
Tackle.UTF8_Strings- UTF8 strings in Ada. UseStringas a literal vehicle and for IO.UTF8_Stringis eagerly validated for truncated sequences, improper continuation bytes, overlong encoding, surrogate and range checks. RaisesEncoding_Errorif invalid. For now, read the package spec. -
Tackle.UTF8_Strings.Codepoint_Iterators-Ada.Containers-likeCursorAPI to traverseUTF8_Stringcodepoint by codepoint. Example:with Ada.Text_IO; with Tackle.UTF8_Strings; with Tackle.UTF8_Strings.Codepoint_Iterators; procedure Demo is use Ada; use Tackle.UTF8_Strings; use Tackle.UTF8_Strings.Codepoint_Iterators; S : constant UTF8_String := From ("Cześć! 😀"); C : Cursor := First (S); begin while Has_Element (C) loop declare CP : constant Codepoint := Element (S, C); begin Text_IO.Put_Line (To_String (CP)); end; C := Next (S, C); end loop; end Demo;
tada build [--profile release|debug]tada test [--profile release|debug]This codebase is written by hand. Claude Code is used for Socratic design exploration and code review.