elixir.ex 692 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. defmodule HelloModule do
  2. @moduledoc """
  3. This is supposed to be `markdown`.
  4. __Yes__ this is [mark](http://down.format)
  5. # Truly
  6. ## marked
  7. * with lists
  8. * more
  9. * and more
  10. Even.with(code)
  11. blocks |> with |> samples
  12. _Docs are first class citizens in Elixir_ (Jose Valim)
  13. """
  14. # A "Hello world" function
  15. def some_fun do
  16. IO.puts "Juhu Kinners!"
  17. end
  18. # A private function
  19. defp priv do
  20. is_regex ~r"""
  21. This is a regex
  22. spanning several
  23. lines.
  24. """
  25. x = elem({ :a, :b, :c }, 0) #=> :a
  26. end
  27. end
  28. test_fun = fn(x) ->
  29. cond do
  30. x > 10 ->
  31. :greater_than_ten
  32. true ->
  33. :maybe_ten
  34. end
  35. end