A tutorial for the Mercury programming language