AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Polymorphism in the Unboxed Types
The idea of an unboxed struct is that it's just something which is wider than a normal data value. So there's never any sentation of it on the heap thit's just, if you have a local variable of type unbox pupil of two ints, then that's the same as having two local variables. They live in separate registers. If you pass them to a function that takes up two of its argument lots instead of taking up one, it has to return a wider structure and so on. The idea is that these things will work like normal ocamia s, but will never be anywhere other than the local variable stock or similar goit.