pkl: unit types #2086
amitu
started this conversation in
Ideas & RFCs
pkl: unit types
#2086
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So in pkl you can write
timeout = 5.ns
(Duration type) ordisc-space = 5.gb
(Data Size type). It's quite funny that these are the only two "unit types" they have. Other types are the usual suspects, String, Integer etc. They do not even have a DateTime type.We already support
timeout.ns: 5
anddisc-space.gb: 5
syntaxes. But they are not great for arithmetic, you can not say5.km + 3.m
for example.We should support a special casing of enums, that resolve into decimals, to allow
timeout: 4.s + 200.ms
etc. Not sure.Beta Was this translation helpful? Give feedback.
All reactions