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 Text replicate, spaces #967
Add Text replicate, spaces #967
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a more general function
Text/replicate : Natural -> Text -> Text
instead?
If we prefer to stick with this one, I'd suggest calling it Text/spaces
.
The implementation could also be slightly simplified by using |
Yeah, I also think a |
- change generateWhitespace to a combination of replicate, spaces - use Prelude.List.replicate instead (simplified)
Cool, I've incorporated both of your feedback. I did decide to keep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly concerned about API bloat with spaces
, but not too much.
Co-Authored-By: Gabriel Gonzalez <Gabriel439@gmail.com>
Adds a function which generates Text with the number of spaces specified by the parameter.
I believe that this merits addition to the standard library because, when generating a configuration file with
dhall text
, it is common for configuration files to have significant whitespace (indentation etc.), and adding this function would make it significantly easier for users to generate precise amounts of whitespace in order to match downstream configuration format requirements.