Skip to content

Instantly share code, notes, and snippets.

@zeldangit
Created November 8, 2017 01:27
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 zeldangit/9448809d80f7613d74189feb9f5529ac to your computer and use it in GitHub Desktop.
Save zeldangit/9448809d80f7613d74189feb9f5529ac to your computer and use it in GitHub Desktop.
:- module test.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
main(!IO) :-
io.write_string("Hello, world!\n", !IO).
:- import_module list.
:- func length(list(T)) = int.
length([]) = 0.
length([_ | Xs]) = 1 + length(Xs).
%$ mmc --make test
%Making Mercury/int3s/test.int3
%Making Mercury/ints/test.int
%Making Mercury/cs/test.c
%test.m:012: In clause for function `length'/1:
%test.m:012: in function result term of clause head:
%test.m:012: error: undefined symbol `+/2'.
%** Error making `Mercury/cs/test.c'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment