View Source Moar.Atom (Moar v0.1.0)

Atom-related functions

Link to this section Summary

Functions

When given a string, converts it to an atom via String.to_atom/1. When given an atom, returns it unchanged.

When given an atom, converts it to a string via Atom.to_string/1. When given a string, returns it unchanged.

Link to this section Functions

@spec from_string(atom() | binary()) :: atom()

When given a string, converts it to an atom via String.to_atom/1. When given an atom, returns it unchanged.

Useful when you aren't sure ahead of time whether you have a string or an atom and want an atom.

@spec to_string(atom() | binary()) :: binary()

When given an atom, converts it to a string via Atom.to_string/1. When given a string, returns it unchanged.

Useful when you aren't sure ahead of time whether you have a string or an atom and want a string.