Mercury - Hello You Program


Home

Author: Fergus Henderson
Date: October 20, 1997
Info: Mercury Project
:- module hello_you.
:- interface.
:- import_module io.

:- pred main(state::di, state::uo) is det.

:- implementation.
:- import_module string.

main -->
	print("What is your name? "),
	read_line(Result),
	(if { Result = ok(CharList) } then
		{ string__from_char_list(CharList, String) },
		print("Hello "), print(String)
	else
		print("Error.\n")
	).

Home