-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ord/chr functions #16
Comments
@bitonic - what's your thoughts on this request? |
@neil-da I'd be OK with it, I think |
As a roadmap for adding new primitives: https://github.com/digital-asset/daml/pull/1346/files |
1 - (naive question) Why explode and implode are not good enough ? 2 - Do we really want non type safe conversion ? I mean, wouldn't it better to introduce a proper Unicode Char type ? 3- In case we go for
Note we have to be sure no subrogate (codepoints ranging from |
Working with characters as code points is soemtimes useful. Implode/explode don't let you do that, and Char is only useful if you can work on it as an Int too, so you might as well use Int and if people want some tiny extra type safety do it in DAML as a newtype. I would suggest error on invalid input, since it's a pretty low level function anyway so people should pay attention. |
Therefore we will have to new builtins:
The later will crash if it finds an |
The two builtins are now available in DAML-LF dev version. This will be integrate in DAML-LF 1.6 together with enum type. |
I believe this is done now that #1536 is merged. |
Requested by @raphael-speyer-da and @andrae-da so they can pack/unpack strings. Concretely, something like
Text -> [Int]
and[Int] -> Text
, or on singleInt
, or something around that area.The text was updated successfully, but these errors were encountered: