|
|
|
|
|
by verttii
2443 days ago
|
|
OK Thanks for adding some context! What I'd do is simply break down the larger pure function into smaller pure functions and sequencing them in the monad. This way you would still retain purity with your functions but you could log every intermediate step by simply logging their output (and its corresponding input). Would probably make the code more maintainable as well. From what I understand Haskell has great tooling for function profiling. Unfortunately, I got no experience with these yet so I can't say if they'd help you solve such problems. Edit: Btw sounds like property based testing might work well as a solution to this kind of problem. It works really well with pure functions. |
|