This PR adds support to the record combinator for "partially enumerable" records, in which the domain is the disjoint union of some enumerable type and some non-enumerable type, such that the domain has an enumerable portion and a non-enumerable portion. In particular, the record combinator enforces that the entire enumerable portion of the domain is present (with values in the codomain), and that any present keys of the non-enumerable portion have values in the codomain, emulating the type-checking behavior of TypeScript.
Other changes:
renamed getDomainKeys to enumerate
added several enumerate tests
implemented the partially enumerable record as an intersection of an enumerableRecord and a nonEnumerableRecord
supported enumeration of the intersection combinator within enumerate
extracted the default record.name into function for use in several places
WIP
This PR adds support to the
record
combinator for "partially enumerable" records, in which the domain is the disjoint union of some enumerable type and some non-enumerable type, such that the domain has an enumerable portion and a non-enumerable portion. In particular, therecord
combinator enforces that the entire enumerable portion of thedomain
is present (with values in thecodomain
), and that any present keys of the non-enumerable portion have values in thecodomain
, emulating the type-checking behavior of TypeScript.Other changes:
getDomainKeys
toenumerate
enumerate
testsintersection
of anenumerableRecord
and anonEnumerableRecord
intersection
combinator withinenumerate
record.name
into function for use in several places