debugging - output a value in Haskell, with a default in case its type is not an instance of Show -
this question has answer here:
- implementation of “show” function 1 answer
i tried debug arrows , hard. end sticking trace
here , there, wants show
instance argument, limits uses. there way show
if instance of show, , use kind of default output value if it's not? promise use debugging ;-)
how people debug arrows anyway...
your best bet compose trace arrow:
strace x = trace (show x) x :: (num c, show c, arrow cat) => cat c c = arr (+1) <<< arr strace -- > 1 -- 1 -- 2
Comments
Post a Comment