From 272b0cd4d78abacc5ce58660f71cac1d4a697505 Mon Sep 17 00:00:00 2001 From: Decio Ferreira Date: Sat, 23 Nov 2024 16:49:19 +0000 Subject: [PATCH] WIP System.IO --- index.html | 22 ++++++++++++++++++++++ src/Main.elm | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 index.html create mode 100644 src/Main.elm diff --git a/index.html b/index.html new file mode 100644 index 000000000..2736b8441 --- /dev/null +++ b/index.html @@ -0,0 +1,22 @@ + + + + + Main + + + + + + + + \ No newline at end of file diff --git a/src/Main.elm b/src/Main.elm new file mode 100644 index 000000000..47b3d3846 --- /dev/null +++ b/src/Main.elm @@ -0,0 +1,18 @@ +module Main exposing (main) + +import System.IO as IO exposing (IO) + + +main : IO.Program +main = + IO.run app + + +app : IO () +app = + IO.pure 1 + |> IO.fmap ((+) 2) + |> IO.fmap String.fromInt + |> IO.bind (IO.hPutStr IO.stdout) + |> IO.bind (\() -> IO.getLine) + |> IO.bind (\name -> IO.hPutStr IO.stdout ("Hello " ++ name))