Skip to content

Commit

Permalink
Exclude override_kernel: false from opts in import __MODULE__, opts
Browse files Browse the repository at this point in the history
  • Loading branch information
jechol committed Feb 19, 2020
1 parent 2d94356 commit dfd4453
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 12 deletions.
4 changes: 3 additions & 1 deletion lib/witchcraft/applicative.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ defclass Witchcraft.Applicative do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Apply, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/apply.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ defclass Witchcraft.Apply do
@type fun :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Functor, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/arrow.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ defclass Witchcraft.Arrow do
@type t :: fun()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Category, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/bifunctor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ defclass Witchcraft.Bifunctor do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Functor, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/category.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ defclass Witchcraft.Category do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Semigroupoid, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/chain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ defclass Witchcraft.Chain do
@type link :: (any() -> Chain.t())

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Apply, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/comonad.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ defclass Witchcraft.Comonad do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Extend, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/extend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ defclass Witchcraft.Extend do
@type colink :: (Extend.t() -> any())

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Functor, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/functor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ defclass Witchcraft.Functor do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/monad.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ defclass Witchcraft.Monad do
use Witchcraft.Chain

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Applicative, unquote(opts)
use Witchcraft.Chain, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/monoid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ defclass Witchcraft.Monoid do
@type t :: any()

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Semigroup, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down
4 changes: 3 additions & 1 deletion lib/witchcraft/traversable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ defclass Witchcraft.Traversable do
@type link :: (any() -> Traversable.t())

defmacro __using__(opts \\ []) do
module_imports = [except: Keyword.get(opts, :except, [])]

quote do
use Witchcraft.Foldable, unquote(opts)
use Witchcraft.Functor, unquote(opts)
import unquote(__MODULE__), unquote(opts)
import unquote(__MODULE__), unquote(module_imports)
end
end

Expand Down

0 comments on commit dfd4453

Please sign in to comment.