I hereby claim:
- I am sketchet on github.
- I am sketchet (https://keybase.io/sketchet) on keybase.
- I have a public key ASDPXud0jjA4I4HaqZJzT4htJ4-cwDaVgzVRY3uYwp0Zrgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
defmodule Parse do | |
def stdin_to_integer() do | |
read_stdin |> String.to_integer | |
end | |
def stdin_to_string() do | |
read_stdin | |
end | |
defp read_stdin() do |
defmodule Print do | |
# print the head of the list | |
def print_list([head | tail]) do | |
IO.puts(head) | |
print_list(tail) | |
end | |
# once list is empty this exectutes | |
def print_list([]) do | |
end |
defmodule Read do | |
def read do | |
case IO.read(:stdio, :line) do | |
# what happens when done | |
:eof -> | |
:ok | |
# errors | |
{:error, reason} -> | |
IO.puts "Error: #{reason}" | |
# operations on each line |