Andrew Schutt
"programming paradigm treats computation as the evaluation of functions"
Functional Programming
Functional Programming
Functional Programming
Functional Programming
Functional Programming
About Elixir
-module(hello_module).
-export([some_fun/0, some_fun/1]).
% A "Hello world" function
some_fun() ->
io:format('~s~n', ['Hello world!']).
% This one works only with lists
some_fun(List) when is_list(List) ->
io:format('~s~n', List).
% Non-exported functions are private
priv() ->
secret_info.
About Elixir
defmodule HelloModule do
# A "Hello world" function
def some_fun do
IO.puts "Hello world!"
end
# This one works only with lists
def some_fun(list) when is_list(list) do
IO.inspect list
end
# A private function
defp priv do
:secret_info
end
end
About Elixir
defmodule HelloModule do
# A "Hello world" function
def some_fun do
IO.puts "Hello world!"
end
# This one works only with lists
def some_fun(list) when is_list(list) do
IO.inspect list
end
# A private function
defp priv do
:secret_info
end
end
-module(hello_module).
-export([some_fun/0, some_fun/1]).
% A "Hello world" function
some_fun() ->
io:format('~s~n', ['Hello world!']).
% This one works only with lists
some_fun(List) when is_list(List) ->
io:format('~s~n', List).
% Non-exported functions are private
priv() ->
secret_info.
About Elixir
About Elixir
About Elixir
About Elixir
About Elixir
Very simple to get a new Phoenix project up and going similar to Rails
Running the above commands generates a simple Twitter clone.
mix phoenix.new example_app
mix ecto.create
mix phoenix.gen.html Comment comments body:string username:string
mix ecto.migrate
Phoenix Framework
Phoenix Framework
Phoenix Framework
Phoenix Framework
Phoenix Framework
Phoenix Framework
Phoenix Framework
Phoenix Framework