From be2bb14bd3e0e1b7bb09d7caa1bab3bb6d813604 Mon Sep 17 00:00:00 2001 From: Al Dee Date: Thu, 21 May 2020 19:30:14 +0100 Subject: Adds IO module with print function. --- src/gleam/io.gleam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/gleam/io.gleam (limited to 'src') diff --git a/src/gleam/io.gleam b/src/gleam/io.gleam new file mode 100644 index 0000000..b7f1691 --- /dev/null +++ b/src/gleam/io.gleam @@ -0,0 +1,17 @@ +external type DoNotLeak + +external fn erl_print(String) -> DoNotLeak = + "io" "fwrite" + +/// Writes string to standard output +/// +/// ## Example +/// +/// > io.print("Hi mum") +/// Nil +/// //=> Hi mum +/// +pub fn print(string: String) -> Nil { + erl_print(string) + Nil +} \ No newline at end of file -- cgit v1.2.3