You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm quickly noticing that the low-level C type of a Stream is unsatisfying. It would be really nice to be able to attach my own type information to a Stream, so I can avoid eg, confusing pressure (Stream Float) with temperature (Stream Float).
Using a newtype of Stream is unsatisfactory, because my new type would not be able to be used within expessions in the copilot DSL.
A phantom type seems like a natural approach, eg:
type Stream t = StreamP p t
And change copilot to use StreamP p everywhere it uses Stream currently. Then I could write eg:
We have had thoughts about similar ways to make Copilot more type-safe. We will need to discuss this approach and the consequences it has on certain operations (casting of values comes to mind).
In general we are currently focused primarily on making Copilot more stable and mature, but having such a feature extension is definitely interesting for future releases.We will discuss the approach with our next meeting.
Although the approach is different, this issue is closely related to #58 and solving that one would solve this one too. I'm going to close this one in favor of #58 simply as a way to manage complexity, but this approach may be simpler and easier to start with.
I'm quickly noticing that the low-level C type of a Stream is unsatisfying. It would be really nice to be able to attach my own type information to a Stream, so I can avoid eg, confusing pressure (Stream Float) with temperature (Stream Float).
Using a newtype of Stream is unsatisfactory, because my new type would not be able to be used within expessions in the copilot DSL.
A phantom type seems like a natural approach, eg:
type Stream t = StreamP p t
And change copilot to use StreamP p everywhere it uses Stream currently. Then I could write eg:
Would you be open to a change along these lines?
The text was updated successfully, but these errors were encountered: