In some case the Compile's syntax is quite straightforward. Es. for rank 1  e rank 2 tensors:

    Quiet[Remove[cf]];
    cf = Compile[
       {{x, _Real, 1}}
       , Total[x]
       ];

and

    Quiet[Remove[cf]];
    cf = Compile[
       {{x, _Real, 2}}
       , Inverse[x]
       ];
Or, even, 

    Quiet[Remove[cf]];
    cf = Compile[
       {{x, _Real, 2}, {y, _Real, 2}}
       , Det[x] + Det[y]
       ];
    cf[matrixA, matrixB]

But what if the arguments are intricated ? What is the syntax needed ? 


A workaround to circumvent this question was proposed [here][1] : *Not the most elegant but could you flatten and join and then "unflatten" and separate afterwards ?*

Please, can you elucidate the topic and give examples for a function having as argument (all atomic expression are understood Real):

- a matrix of lists
- a matrix of matrices
- a matrix whose element are {x_Real , a matrix }
- a matrix whose element are {x_List , a matrix }
- etc.


  [1]: http://http%20:%20//%20mathematica.stackexchange.com/questions/39360/can%20-%20i%20-%20return%20-%20lists%20-%20with%20-%20different%20-%20dimensions%20-%20from%20-%20a%20-%20compiled%20-%20function