Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :- module test.
- :- interface.
- :- import_module io.
- :- pred main(io::di, io::uo) is det.
- :- type foo ---> foo(int).
- :- pred is_five(foo::in) is semidet.
- :- implementation.
- :- pragma foreign_proc("C", is_five(Foo::in),
- [promise_pure, will_not_call_mercury],
- "
- SUCCESS_INDICATOR = (Foo == 5);
- ").
- main(!IO) :-
- Foo = foo(5),
- ( is_five(Foo) ->
- print("Foo is five\n", !IO)
- ;
- print("Foo is not five\n", !IO)
- ).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement