You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
A function like
toLower
lowercases astring
, returning astring
. 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.The text was updated successfully, but these errors were encountered: