Errors considered harmful

If you’re saying that you use clause failures as a kind of if-then-else (or as a selection based on functor-arity), then that’s what I do a lot of – but the overall selection has to succeed. (In some cases, there can be a bit of backtracking, with a predicate call on the right of the :- providing an additional test - but that’s again just part of the if-then-else structure.

In other words, I think that I can rewrite most of my predicates with the new => (Picat) style.

I occasionally use something like convlist or include that depend on predicate success/failure; but the majority of my code could be fairly straightforwardly transformed into Haskell or similar.

As an aside: I’ve dabbled with constraints – they’re lovely when they work, but have their own set of problems for debugging.

1 Like