Be more forgiving about (currently) undefined types #20

Closed
opened 2022-07-23 15:24:04 +00:00 by glen · 1 comment
Owner

When a typed-function is bundled, perhaps just ignore any implementations that use an undefined type, and record that the typed-function depends on that type, so it will be invalidated when the type is defined. For doing those dependencies, it might be convenient rather than putting all of the types in a single special key 'Types' to use a syntactic variant to mark types as opposed to operations. We are limited here by Javascript identifier conventions. So, for example, we could say that to define the number type, a module should export the identifier _number_ (sort of like type names are in italics ;) with the properties 'test' and 'from' giving the definition of the type and the conversions from other types).

When a typed-function is bundled, perhaps just ignore any implementations that use an undefined type, and record that the typed-function depends on that type, so it will be invalidated when the type is defined. For doing those dependencies, it might be convenient rather than putting all of the types in a single special key 'Types' to use a syntactic variant to mark types as opposed to operations. We are limited here by Javascript identifier conventions. So, for example, we could say that to define the `number` type, a module should export the identifier `_number_` (sort of like type names are in italics ;) with the properties 'test' and 'from' giving the definition of the type and the conversions from other types).
Author
Owner

The advantage of this feature is that then you can have a module defining an operation for many types, even though the types may not end up all being defined, without a type error when the bundle is created. The signatures that use unknown types are simply ignored (at that time; if the type shows up, the function will be rebundled).

The advantage of this feature is that then you can have a module defining an operation for many types, even though the types may not end up all being defined, without a type error when the bundle is created. The signatures that use unknown types are simply ignored (at that time; if the type shows up, the function will be rebundled).
glen closed this issue 2022-07-24 19:53:41 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: glen/pocomath#20
No description provided.