--  Attributes that are functions of a subtype as generic actuals (RM 12.6(8)).
with Ada.Text_IO;
procedure Main is
   generic
      type T is private;
      with function Show (X : T) return String;
      with function Combine (A, B : T) return T;
   procedure Print (A, B : T);
   procedure Print (A, B : T) is
   begin
      Ada.Text_IO.Put_Line (Show (Combine (A, B)));
   end Print;
   type Colour is (Red, Green, Blue);
   procedure Print_Max is new Print (Integer, Integer'Image, Integer'Max);
   procedure Print_Min is new Print (T => Float, Show => Float'Image, Combine => Float'Min);
   procedure Print_Colour is new Print (Colour, Colour'Image, Colour'Max);
begin
   Print_Max (3, 9);
   Print_Min (2.5, 1.5);
   Print_Colour (Green, Red);
end Main;
