add .formatter.exs + format

This commit is contained in:
Martino Visintin
2018-05-22 21:46:54 +01:00
parent 08c90ce0d8
commit b07df7c780
52 changed files with 332 additions and 264 deletions

View File

@@ -3,7 +3,7 @@ defmodule Protocols do
@intro "Want to follow the rules? Adhere to the protocol!"
defprotocol School, do: def enroll(person)
defprotocol(School, do: def(enroll(person)))
defimpl School, for: Any do
def enroll(_) do
@@ -16,9 +16,9 @@ defmodule Protocols do
defstruct name: ""
end
defmodule Musician, do: defstruct name: "", instrument: ""
defmodule Dancer, do: defstruct name: "", dance_style: ""
defmodule Baker, do: defstruct name: ""
defmodule(Musician, do: defstruct(name: "", instrument: ""))
defmodule(Dancer, do: defstruct(name: "", dance_style: ""))
defmodule(Baker, do: defstruct(name: ""))
defimpl School, for: Musician do
def enroll(musician) do