View Source HypeLib.Prelude (HypeLib v2.1.0)

The Prelude module contains utility functions for working with external dependencies like TypeCheck, the Elixir Logger moudle etc.

Link to this section Summary

Functions

Imports TypeCheck and requires the Erlang logger

Imports the Ecto schema functions and all changeset functions

Imports the Absinthe notation module

Imports the HypeLib.Utils.String module as StringUtils into the current context.

Link to this section Functions

@spec core() :: Macro.t()
@spec core() :: Macro.t()

Imports TypeCheck and requires the Erlang logger

@spec entity() :: Macro.t()
@spec entity() :: Macro.t()

Imports the Ecto schema functions and all changeset functions

@spec graphql() :: Macro.t()
@spec graphql() :: Macro.t()

Imports the Absinthe notation module

@spec string() :: Macro.t()
@spec string() :: Macro.t()

Imports the HypeLib.Utils.String module as StringUtils into the current context.

examples

Examples

iex> defmodule TokenGenerator do
...>   use HypeLib.Prelude, :string
...>
...>   @spec! generate_token() :: String.t()
...>   def generate_token() do
...>     StringUtils.Generator.generate_string!(1, ~w(a))
...>   end
...> end
...>
...> TokenGenerator.generate_token()
"a"