Type declarations as type factories