Created
February 6, 2014 23:14
-
-
Save bartosz-witkowski/8854480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- 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