1.24. Generic Structs and Unions

Felix structs and unions can be generic too. Here is a simple example.
Start C++ section to tut/examples/tut135e.flx[1 /1 ]
     1: include "std";
     2: union list[T] =
     3:   | Cons of T * list[T]
     4:   | Empty
     5: ;
     6: 
     7: struct pair[T,U] =
     8: {
     9:   fst : T;
    10:   snd : U;
    11: }
    12: 
    13: var x = Cons[int] (1,Empty[int]);
    14: x =  Cons[int] (2,x);
    15: x = Cons[int] (3,x);
    16: 
    17: val y = pair[int,int] (1,2);
    18: print y.fst; print ","; print y.snd; endl;
    19: 
End C++ section to tut/examples/tut135e.flx[1]