Croma

Elixir macro utilities.

Build StatusHex.pmHex.pmGithub IssuesPending Pull-Requests

Usage

Croma.Defpt.defpt

Unit-testable defp that is simply converted to

Croma.Defun

Type specification oriented function definition

is expanded to ex @spec f(integer, String.t) :: String.t def f(a, b) do "#{a} #{b}" end

is expanded to ex @spec dumbmap([a], (a -> b)) :: [b] when a: term, b: term def dumbmap(as, f) def dumbmap([], _) do [] end def dumbmap([h | t], f) do [f.(h) | dumbmap(t, f)] end