mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
tests/hard_coded/*.m:
Update programming style, unless doing so would change
the meaning of the test, in particular:
- use '.' as a module qualifier in place of '__'
- use {write,print}_line where appropriate
- use if-then-else in place of C -> T ; E
- use state variables in place of DCGs
tests/hard_coded/dir_test.m:
Document what the expected outputs correspond to.
Use a uniform module qualifier in the output.
tests/hard_coded/dir_test.exp*:
Conform to the above change.
38 lines
879 B
Mathematica
38 lines
879 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
:- module unify_existq_cons.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module enum.
|
|
:- import_module char.
|
|
:- import_module int.
|
|
|
|
:- type tc
|
|
---> some [T] tc(T) => enum(T).
|
|
|
|
main(!IO) :-
|
|
( if
|
|
( p('new tc'('a'))
|
|
; p('new tc'(2))
|
|
)
|
|
then
|
|
io.write_string("test failed\n", !IO)
|
|
else
|
|
io.write_string("test succeeded\n", !IO)
|
|
).
|
|
|
|
:- pred p(tc::in) is semidet.
|
|
|
|
% Mode analysis must treat the headvar unification here as a construction
|
|
% followed by a var-var unification. If it treats it as a deconstruction
|
|
% the argument unifications will be ill-typed.
|
|
p('new tc'(1)).
|