implement generics (generic types) in kaitai struct?
Dear kaitai devs, first of all - thanks a lot for the great tool!

I wonder if it is possible, and, if not possible, whether it is planned, to implement generic types in kaitai? For reference, please see this stackoverflow question, currently having bounty on it: https://stackoverflow.com/q/74140208/9904592

By generic type I mean a kaitai type that accepts another type as parameter. Use-cases for this are plenty. Pointers are one case where it's desperately needed. Let's say in a binary file, some `u4` points to an offset within the file where a type `my_type` is located. In kaitai it is easily implemented as follows:

```
seq:
  - id: some_pointer
    type: my_type_ptr
types:
  my_type:
    seq:
      - id: some_data
        size: 100
  my_type_ptr:
    seq:
      - id: ptr
        type: u4
    instances:
      data:
        pos: ptr
        type: my_type        
```

In this case, `my_ptr` reads a four bytes integer specifying an offset, and it also has an instance of `my_type` type at the specified offset. But what if I have pointers not only to `my_type` kinds of things but to a dozen or a hundred of other types? Then I need to define a separate `my_ptr` pointer for each of those types. The same holds with respect to generic arrays etc. I would imagine having a pointer type in kaitai like follows:

```
seq:
  - id: some_pointer
    type: ptr<u4,my_type>
types:
  my_type:
    seq:
      - id: some_data
        size: 100
```

or being able to implement generic types, for example, as follows:

```
seq:
  - id: some_pointer
    type: u4ptr(my_type)
types:
  my_type:
      seq:
        - id: some_data
          size: 100
  ptr:
    params:
      - id: pointer_dtype
        type: strz
    seq: 
      - id: ptr_address
        type: u4
    instances:
      data:
        pos: ptr_address
        type: type_eval(pointer_dtype)        
```

It is syntactically concise and clear, hardly comparable to the first example.

Because I can't find answer in the documentation and on SO, let me ask if there is such concept in kaitai? if not, is it planned to be implemented at some point in future? I think pointers to types, and pointers to arrays are a much needed feature, and generics would be one possibel solution here