View Source Euclid.Atom (Euclid v0.4.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. Useful when you aren't sure ahead of time whether you have a string or an atom and want an atom.

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.

Link to this section Functions

Specs

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.

Specs

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.