The line datatype z = datatype PosixPrimitive.file_desc gives you access to the type (now renamed z), but more importantly it gives you access to all of the constructors (not renamed), which you can now use in patterns and the like without having to use the initial PosixPimitive. prefix.