3 ms·
> Merging an empty belt with any other belt, makes no difference. I know the intended meaning was that it makes no difference to the result belt's type, but in
by an_ko 6y ago
> Merging an empty belt with any other belt, makes no difference.
I know the intended meaning was that it makes no difference to the result belt's type, but in-game it does have the important difference of putting all material from the input belt onto just 1 side of the output belt, halving throughput.
If in this image https://bartoszmilewski.files.wordpress.com/2020/11/unit.png https://bartoszmilewski.files.wordpress.com/2020/11/unit.png the incoming belt had both sides filled, both would go onto only one side of the outgoing belt, possibly causing some stalling.
Do type systems exist that include a notion of "throughput" or "capacity" like this?
- mgradowski 6y agoDependent types could presumably capture this idea. They are very expressive – see [1] for a perfectly type-safe printf implementation in Idris. [1]: https://gist.github.com/chrisdone/672efcd784528b7d0b7e17ad9c115292 https://gist.github.com/chrisdone/672efcd784528b7d0b7e17ad9c...
- rrobukef 6y agoThe inserter type is wrong when considering fluids, maybe it should be `inserter: Item a => a -> a'? Oh well, leaky abstractions are endemic.
- mhh__ 6y agoFrom a practical perspective, I think considering throughput is a task that should be done by something utilizing the typesystem rather than the typesystem itself - i.e. give all Operations a throughput but don't try and do the checks on every single application of said operation.