• 1
    2
    Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    Elixir 1.15.7 (compiled with Erlang/OTP 26)

    1
    echo "IO.puts("Hello world, from Elixir")" > hello_world.exs && elixir hello_world.exs

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    learning_elixir
    ├── lib
    │   └── learning_elixir.ex
    ├── test
    │   ├── learning_elixir_test.exs
    │   └── test_helper.exs
    ├── .formatter.exs
    ├── .gitignore
    ├── mix.exs
    └── README.md

    1
    2
    3
    4
    5
    defmodule MyModule do
      def my_function(arg1, arg2) do
        # function body
      end
    end

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    defmodule BasicMath do
      @moduledoc """
      This module provides basic math operations.
      """
    
      @doc """
      Adds two numbers together.
    
      ## Examples
    
          iex> MyModule.add(2, 3)
          5
      """
      def add(a, b) do
        a + b
      end
    end