gpt4 book ai didi

haskell - 仅在 pretty-print 时坚持使用 2 种布局

转载 作者:行者123 更新时间:2023-12-01 06:25:58 25 4
gpt4 key购买 nike

我正在漂亮地打印 C++ 方法声明,并且如果参数列表适合该行,我希望以紧凑的形式呈现参数列表:

void method(MyLongClassName& instance, const MyClass& c);
或者在列中格式化,如果它没有:
void method(      MyLongClassName& instance,
const MyClass& c,
int counter);
我想排除的所有其他布局。
wl-pprint似乎都不简单也没有 pretty ,如果不是黑客攻击的来源。
有任何想法吗?

最佳答案

一个更普遍的问题的解决方案如何选择适合单行的布局,或者如果没有,使用替代品可以在这里找到:Optional spaces and multiple alternatives in wl-pprint-extras

关于haskell - 仅在 pretty-print 时坚持使用 2 种布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28568336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com