diff --git a/examples/blah/build/Blah.mjs b/examples/blah/build/Blah.mjs new file mode 100644 index 0000000..e69de29 diff --git a/examples/blah/build/Spark/IO.mjs b/examples/blah/build/Spark/IO.mjs new file mode 100644 index 0000000..e69de29 diff --git a/examples/blah/build/spark.prelude.mjs b/examples/blah/build/spark.prelude.mjs new file mode 100644 index 0000000..e69de29 diff --git a/examples/blah/spark.toml b/examples/blah/spark.toml new file mode 100644 index 0000000..a809a8e --- /dev/null +++ b/examples/blah/spark.toml @@ -0,0 +1 @@ +name = "Blah" \ No newline at end of file diff --git a/examples/blah/src/Blah.spark b/examples/blah/src/Blah.spark new file mode 100644 index 0000000..75ad651 --- /dev/null +++ b/examples/blah/src/Blah.spark @@ -0,0 +1,6 @@ +import Spark/IO + +def pub main = + \_ <- IO.println("Hello, world!") |> IO.then + \_ <- IO.println("This is the Blah module") |> IO.then + IO.println("Bye!") \ No newline at end of file diff --git a/src/templates/Spark/IO.spark b/src/templates/Spark/IO.spark new file mode 100644 index 0000000..726ccbb --- /dev/null +++ b/src/templates/Spark/IO.spark @@ -0,0 +1,13 @@ +def pub println\text = + \ <- action + external " + console.log(text); + return $.nil; + " + +def pub then\@IO { perform }, f = + \ <- action + f(perform()).perform() + +def action\perform = + @IO { perform } \ No newline at end of file