Mating type

Mating types are molecular mechanisms that regulate compatibility in sexually reproducing eukaryotes. They occur in isogamous and anisogamous species. Depending on the group, different mating types are often referred to by numbers, letters, or simply "+" and "−" instead of "male" and "female", that refer to "sexes" or differences in size between gametes. Syngamy can only take place between gametes carrying different mating types.
Reproduction regulated by mating types is especially prevalent in fungi. Filamentous ascomycetes usually have two mating types referred to as "MAT1-1" and "MAT1-2", following the yeast mating type locus MAT. Under standard nomenclature, MAT1-1 (which may informally be called MAT1) encodes for a regulatory protein with a high motility-group (HMG) DNA-binding motif, while MAT1-2 (informally called MAT2) encodes for a protein with an alpha box motif, as in the yeast mating type MATα1. The corresponding mating types in yeast, a non-filamentous ascomycete, are referred to as MATa and MATα.
Mating type genes in ascomycetes are called idiomorphs rather than alleles due to the uncertainty of the origin by common descent. The proteins they encode are transcription factors that regulate both the early and late stages of the sexual cycle. Heterothallic ascomycetes produce gametes that present a single Mat idiomorph and syngamy will only be possible between gametes carrying complementary mating types. On the other hand, homothallic ascomycetes produce gametes that can fuse with every other gamete in the population (including its own mitotic descendants) most often because each haploid contains the two alternate forms of the Mat locus in its genome. 
Basidiomycetes on the other hand can have thousands of different mating types.
The adaptive function of mating type in the ascomycete "Neurospora crassa" is discussed in the article "Neurospora crassa". That matings in "N. crassa" are restricted to interaction of strains of opposite mating type may be an adaptation to promote some degree of outcrossing. Outcrossing, through complementation, could provide the benefit of masking recessive deleterious mutations in genes that function in the dikaryon and/or diploid stage of the life cycle.