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
Is your feature request related to a problem? Please describe.
I wanted to implement "labels" in a git commit message with lines of the form "label: value". Using the current Template functionality, adding a line is easy (concat(), String.join()) but removing is trickier. An LLM generated description.lines().filter(...) which looked correct before I tried it and discovered filter() was hallucinated.
Describe the solution you'd like List.filter() in a similar form to List.map()
Describe alternatives you've considered @bryceberger put together a workaround using List.map() which uses the empty string for excluded lines and moves the "gather" operation (join in this case) into the map expression.
description.lines().map(|line| if(<predicate>, line ++ "\n")).join("")
Still, there are clear limitations with this approach and I wouldn't expect it to be maintainable extending beyond a few successive calls. So while it does the trick, I think there's an opportunity to add a more ergonomic alternative.
Is your feature request related to a problem? Please describe.
I wanted to implement "labels" in a git commit message with lines of the form "label: value". Using the current Template functionality, adding a line is easy (
concat()
,String.join()
) but removing is trickier. An LLM generateddescription.lines().filter(...)
which looked correct before I tried it and discoveredfilter()
was hallucinated.Describe the solution you'd like
List.filter()
in a similar form toList.map()
Describe alternatives you've considered
@bryceberger put together a workaround using
List.map()
which uses the empty string for excluded lines and moves the "gather" operation (join
in this case) into the map expression.Still, there are clear limitations with this approach and I wouldn't expect it to be maintainable extending beyond a few successive calls. So while it does the trick, I think there's an opportunity to add a more ergonomic alternative.
Additional context
Discord discourse: https://discord.com/channels/968932220549103686/1326247959213506682
The text was updated successfully, but these errors were encountered: