Did DA considered to add a function such as isNonEmpty
- cohen.avrahamOP
G-d willing
Hello,
Would you consider adding another function to theDA.Textlib a function such as:isNonEmptyText: Text -> Bool isNonEmptyText text = (not . Text.isEmpty) textThis is something that I do quite often, and instead of repeating this code in every place I use it, or placing it in a separated package, this way all my packages will use it, sounds a bit too much.
Thanks,
- Johan_Sjodin
Hi @cohen.avraham,
you could as well define it as
isNonEmptyText : Text -> Bool isNonEmptyText = (/=) ""or simply use
text /= ""instead ofisNonEmptyText text.Hope that helps,
Johan - cohen.avraham
Thanks @Johan_Sjodin for your reply.
I am aware of this, but I was curious about a dedicated function for it like there is forisEmpty
Anyway, thanks again - WallaceKelly 1
It is open source.
github.com/digital-asset/daml
Here is an implementation:Add DA.Text.isNotEmpty function
digital-asset:main←digital-asset:add-da-text-isnotemptyA `Text.isNotEmpty` function is needed frequently enough to warrant being added …