Skip to content

Instantly share code, notes, and snippets.

@PragTob

PragTob/doctest.ex

Last active Jul 26, 2017
Embed
What would you like to do?
doctests
@doc """
## Examples
iex> {:ok, pid} = Agent.start_link(fn -> 42 end)
iex> Agent.get_and_update(pid, fn(state) -> {state, state + 1} end)
42
iex> Agent.get(pid, fn(state) -> state end)
43
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment