Parametrise modules
I would like to be able to parametrise modules by types and lifetimes. Type parameters are useful where many items in a module should use the same concrete type. E.g., taking some implementation as a parameter we want to ensure that all functions and data types in a module use the same implementor without annotating every item with the same type parameters. Likewise, parameterising by lifetimes is useful if we are to assume that many objects in a module have the same lifetime. This is especially useful in conjunction with arena allocation. ## Details Module declarations may have formal type and lifetime parameters and where clauses, e.g, `mod foo<X, 'a> where X: Bar { ... }`. Module uses, including in use expressions which include an alias, can have actual type and lifetime parameters. E.g, `let x: foo<int>::Baz = ...;` or `use foo<int, 'static> as int_foo`. The usual rules around well-formedness wrt bounds, and inference would apply.
Posted by nrc on Oct 30, 2014, 5:12 AM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.9,000 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Parametrise modules
I would like to be able to parametrise modules by types and lifetimes. Type parameters are useful where many items in a module should use the same concrete type. E.g., taking some implementation as a parameter we want to ensure that all functions and data types in a module use the same implementor without annotating every item with the same type parameters. Likewise, parameterising by lifetimes is useful if we are to assume that many objects in a module have the same lifetime. This is especially useful in conjunction with arena allocation. ## Details Module declarations may have formal type and lifetime parameters and where clauses, e.g, `mod foo<X, 'a> where X: Bar { ... }`. Module uses, including in use expressions which include an alias, can have actual type and lifetime parameters. E.g, `let x: foo<int>::Baz = ...;` or `use foo<int, 'static> as int_foo`. The usual rules around well-formedness wrt bounds, and inference would apply.
Comments (0)
No comments yet. Start the discussion.