I was wondering if cases where format control is possible in typing constructs can allow things like restricting the implementation size after compilation of a specific variant type. Say, for instance that I wanted to have a malloc implementation instead of returning a Some 'a | None type that compiles down to a boxed case of first a word and then the subsequent 'a instance, down to the 'a instance, where in the values of the word enum (or tag) are not present in the possibilities of the 'a instance.

Maybe it sounds silly, but in really tight loops you want to squeeze for efficiency. So I was wondering if maybe the same actual code be used with the same sanity of type checking, but some annotation provided at the type declaration to allow such optimization to take place.