Did DA considered to add a function such as isNonEmpty
App Development4 posts85 views1 likesLast activity Oct 2024
CO
cohen.avrahamOP
Sep 2024G-d willing
Hello,
Would you consider adding another function to the DA.Text lib a function such as:
isNonEmptyText: Text -> Bool
isNonEmptyText text = (not . Text.isEmpty) text
This 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,
JO
Johan_Sjodin
Sep 2024Hi @cohen.avraham,
you could as well define it as
isNonEmptyText : Text -> Bool
isNonEmptyText = (/=) ""
or simply use text /= "" instead of isNonEmptyText text.
Hope that helps,
Johan
CO
cohen.avraham
Sep 2024Thanks @Johan_Sjodin for your reply.
I am aware of this, but I was curious about a dedicated function for it like there is for isEmpty
Anyway, thanks again
WA
WallaceKelly
Oct 2024It is open source.
Here is an implementation:
Add DA.Text.isNotEmpty function
digital-asset:main ← digital-asset:add-da-text-isnotempty
A `Text.isNotEmpty` function is needed frequently enough to warrant being added …