use extensible effects and make the api more opaque
error rates example
cabal