Phantom Types
← Back to Advanced Type Features
Type parameters that appear in the type signature but are not used in the data representation. Phantom types encode additional compile-time information (such as units, state, or permissions) without any runtime cost, preventing invalid operations through the type system.