A general framework for computing with judgements