aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl Dee <amyalicedee@gmail.com>2020-05-21 19:30:14 +0100
committerLouis Pilfold <louis@lpil.uk>2020-05-21 23:22:36 +0100
commitbe2bb14bd3e0e1b7bb09d7caa1bab3bb6d813604 (patch)
treee576e75e69d721af404b79bb17c6f25b80fd0baf /src
parentd8ea3288e1a201e89458c4850269525200740fe6 (diff)
downloadgleam_stdlib-be2bb14bd3e0e1b7bb09d7caa1bab3bb6d813604.tar.gz
gleam_stdlib-be2bb14bd3e0e1b7bb09d7caa1bab3bb6d813604.zip
Adds IO module with print function.
Diffstat (limited to 'src')
-rw-r--r--src/gleam/io.gleam17
1 files changed, 17 insertions, 0 deletions
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