forsyde / forsyde-atom

A shallow-embedded DSL for modeling cyber-physical systems
https://forsyde.github.io/forsyde-atom/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Time type class #33

Closed ugeorge closed 4 years ago

ugeorge commented 7 years ago

Although a good numerical representation for (continuous) time, Rationals are resource-consuming, and sometimes the model might accept trade-offs in precision vs. performance. A better approach would be to make Time a type class. Clear semantics need to be defined. Special care needs to be taken when instantiating e.g. Float as time, because we lose comparison operations.

ugeorge commented 5 years ago

Increasing priority. The Time type is too restrictive to arithmetic operators, forcing any meaningful operation in CT to have the values of Time as well. There should be a class TimeCompatible or something similar, to represent types that can perform operations along with time values.

ugeorge commented 4 years ago

Addressed in #42 No type class though, but rather additional type constraints, aliases and instructions.