Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图调试一些箭头,这真的很难。我最终坚持trace在这里和那里,但它真的想要一个Show实例作为它的参数,这限制了它的用途。如果它是 Show 的一个实例,有什么办法show吗?如果不是,则使用某种默认输出值?我保证仅将其用于调试;-)
trace
Show
show
无论如何,人们如何调试Arrows...
您最好的选择是将跟踪写入您的箭头:
strace x = trace (show x) x something :: (Num c, Show c, Arrow cat) => cat c c something = arr (+1) <<< arr strace -- > something 1 -- 1 -- 2