Skip to content

Instantly share code, notes, and snippets.

@bartosz-witkowski
Created February 6, 2014 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartosz-witkowski/8854480 to your computer and use it in GitHub Desktop.
Save bartosz-witkowski/8854480 to your computer and use it in GitHub Desktop.
:- module mtest.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module integer, string, list.
% must be di, uo
:- pred pred1(A::di, A::uo) is det.
pred1(!A).
:- pred pred2(A::di, A::uo) is det.
pred2(!A).
:- pred semi_pred(A::di, A::uo) is semidet.
semi_pred(!A).
% works as expected no worries
:- pred uniques(A::di, A::uo) is det.
uniques(!A) :-
pred1(!A),
pred2(!A).
:- pred uses_semi(A::di, A::uo) is det.
uses_semi(!A) :-
pred1(!A), % unique
(if semi_pred(!A) then
true
else
true),
pred2(!A). % mosly_unique
main(!IO) :-
io.print("It works!", !IO).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment