View Source Dreamy 😴
Dreamy provides useful macros, functions, types & operators to make elixir even dreamier 😴
- 📔 Docs: https://hexdocs.pm/dreamy/readme.html
- 💾 download: https://hex.pm/packages/dreamy
Modules
Dreamy
: Dreamy provides useful macros, functions, types & operators to make elixir even dreamier 😴Dreamy.Defaults
: Helpers for dealing with Defaults for functionsDreamy.Either
: Datatype for representing Either, OrDreamy.Monodic
: Functions for use with both Result and Option monadsDreamy.Option
: Functions for use with OptionsDreamy.Result
: Functions for use with :ok, and :error tuplesDreamy.Types
: Useful Type definitions
Usage
defmodule Example.Usage do
use Dreamy
# read file and split into a map of software => version,
# -> %{"elixir" => "x.x.x", "erlang" => "x.x.x"}
@spec versions() :: map()
def versions do
File.read!(".tool-versions")
|> String.split("\n", parts: 2)
>>> (&String.trim/1)
>>> (&String.split/1)
>>> (&List.to_tuple/1)
|> Enum.into(%{})
end
end
Installation
Available in Hex, the package can be installed
by adding dreamy
to your list of dependencies in mix.exs
:
def deps do
[
{:dreamy, "~> 0.2.3"}
]
end