Skip to content
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

Improve structural preservation #17

Open
twpayne opened this issue Mar 5, 2024 · 0 comments
Open

Improve structural preservation #17

twpayne opened this issue Mar 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@twpayne
Copy link
Member

twpayne commented Mar 5, 2024

A function like toLower lowercases a string, returning a string. Thanks to eachString it can also operate on a []string and return a []string.

This sort of structure-aware mapping (I think the functional programming folk call it fmap would be great to extend to a wider range of types, for example nested slices ([][]string) or maps (map[any]string).

A general solution to this will likely involve some advanced use of reflect and or some gnarly generics work.

@twpayne twpayne added the enhancement New feature or request label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant