question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add text primitives in DAML 1.dev for experiments.

See original GitHub issue

The idea is to add LF primitives for:

  • toUpper/toLower
  • replicate/fill
  • break/breakOn/stripInfix… and other missing List counterparts
  • containsOnlyAlphabet: Text -> Text -> Bool (useful for isDigital, isAlpha, isWhitespace, isAscii and similar functions)
  • split/join

cc @cocreature @jberthold-da

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Dec 4, 2019

@cocreature pointed out that take and drop aren’t primitive, so I’m adding those.

1reaction
cocreaturecommented, Dec 3, 2019

I took a brief look at the unicode standard, in particular, section 4 in https://www.unicode.org/versions/Unicode12.0.0/ch04.pdf paragraph “Case Mapping”. It looks like a nice option might be to use the data from UnicodeData.txt which is not dependent on weird things but not use SpecialCasing.txt because nobody likes special cases and that is context dependent.

However, I have no clue how easy it is to do that on the JVM or anywhere else so while this seems easy to specify and less restrictive than nly allowing ASCII, I’m not sure it is actually a reasonable option.

I don’t really like A2 and it seems to go against the spirit of those primitives which are all about performance and I agree that A3 is not a very nice specification even though it probably does what you want™ in basically all cases. So I’m leaning towards A1, what do you think @remyhaemmerle-da? @filmackay Would ASCII be sufficient for your usecases?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference: Built-in Functions — Daml SDK 2.4.2 documentation
Daml has these built-in functions for working with text: <> operator: concatenates two Text values. show converts a value of the primitive types...
Read more >
Release of Daml Connect 1.10.0 - Digital Asset Blog
Set allowing maps and sets with arbitrary serializable types as keys/members. This supersedes the TextMap type and standard library modules DA.
Read more >
Great introduction to Daml by Andreas given as Guest Lecture ...
Get started with Daml : https://bit.ly/tryDaml Learn more about Daml Smart Contracts: https://bit.ly/learn_daml Check out our blogs: ...
Read more >
JavaScript Client Libraries — Daml SDK 0.0.0 documentation
The @daml/types library contains TypeScript data types corresponding to primitive Daml data types, such as Party or Text . It is used by...
Read more >
daml/daml-lf-1.rst at main · digital-asset/daml - GitHub
Contribute to digital-asset/daml development by creating an account on GitHub. ... add BigNumeric primitive type - add RoundingMode primitive type and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found