{"id":22359069,"url":"https://github.com/bwireman/dreamy","last_synced_at":"2025-07-18T02:34:07.676Z","repository":{"id":206753200,"uuid":"717622659","full_name":"bwireman/dreamy","owner":"bwireman","description":"  Dreamy provides useful macros, functions, types \u0026 operators to make elixir even dreamier 😴","archived":false,"fork":false,"pushed_at":"2024-03-23T21:40:54.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T00:39:00.809Z","etag":null,"topics":["dev","elixir","macros","monads"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/dreamy","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwireman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-12T03:03:21.000Z","updated_at":"2024-03-24T19:01:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"494e58a4-179d-4431-a09d-18bd11023fa4","html_url":"https://github.com/bwireman/dreamy","commit_stats":null,"previous_names":["bwireman/dreamy"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bwireman/dreamy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fdreamy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fdreamy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fdreamy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fdreamy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwireman","download_url":"https://codeload.github.com/bwireman/dreamy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fdreamy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265692351,"owners_count":23812196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dev","elixir","macros","monads"],"created_at":"2024-12-04T15:19:22.787Z","updated_at":"2025-07-18T02:34:07.653Z","avatar_url":"https://github.com/bwireman.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dreamy 😴\n\n[![ci](https://github.com/bwireman/dreamy/actions/workflows/elixir.yml/badge.svg?branch=main)](https://github.com/bwireman/dreamy/actions/workflows/elixir.yml)\n[![mit](https://img.shields.io/github/license/bwireman/dreamy?color=brightgreen)](https://github.com/bwireman/dreamy/blob/main/LICENSE)\n[![commits](https://img.shields.io/github/last-commit/bwireman/dreamy)](https://github.com/bwireman/dreamy/commit/main)\n[![1.0.0](https://img.shields.io/hexpm/v/dreamy?color=brightgreen\u0026style=flat)](https://hexdocs.pm/dreamy/readme.html)\n[![downloads](https://img.shields.io/hexpm/dt/dreamy?color=brightgreen)](https://hex.pm/packages/dreamy/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com)\n![Dreamy 😴](https://img.shields.io/badge/Dreamy%20%F0%9F%98%B4-blue)\n\nDreamy provides useful macros, functions, types \u0026 operators to make elixir even dreamier 😴\n\n- 📔 [Docs](https://hexdocs.pm/dreamy/readme.html)\n- 💾 [Download](https://hex.pm/packages/dreamy)\n- 👾 [Discord Post](https://discord.com/channels/269508806759809042/1198686632988127344/1198686632988127344)\n\n## Modules\n\n- [`Dreamy`](https://hexdocs.pm/dreamy/Dreamy.html): Dreamy provides useful macros, functions, types \u0026 operators to make elixir even dreamier 😴\n- [`Dreamy.Defaults`](https://hexdocs.pm/dreamy/Dreamy.Defaults.html): Helpers for dealing with Defaults for functions\n- [`Dreamy.Either`](https://hexdocs.pm/dreamy/Dreamy.Either.html): Datatype for representing Either, Or\n- [`Dreamy.Monodic`](https://hexdocs.pm/dreamy/Dreamy.Monodic.html): Functions for use with both Result and Option monads\n- [`Dreamy.Option`](https://hexdocs.pm/dreamy/Dreamy.Option.html): Functions for use with Options\n- [`Dreamy.Result`](https://hexdocs.pm/dreamy/Dreamy.Result.html): Functions for use with :ok, and :error tuples\n- [`Dreamy.Types`](https://hexdocs.pm/dreamy/Dreamy.Types.html): Useful Type definitions\n\n## Usage\n\n```elixir\ndefmodule Example.Usage do\n  use Dreamy\n\n  # read file and split into a map of software =\u003e version,\n  # -\u003e %{\"elixir\" =\u003e \"x.x.x\", \"erlang\" =\u003e \"x.x.x\"}\n  @spec versions() :: map()\n  def versions do\n    File.read!(\".tool-versions\")\n    |\u003e String.split(\"\\n\", parts: 2)\n    \u003e\u003e\u003e (\u0026String.trim/1)\n    \u003e\u003e\u003e (\u0026String.split/1)\n    \u003e\u003e\u003e (\u0026List.to_tuple/1)\n    |\u003e Enum.into(%{})\n  end\n\n  defp foo(x), do: {:ok, x + 1}\n\n  defp bar(x), do: {:ok, x * 2}\n\n  # managing results without Dreamy\n  def without_dreamy(x) do\n    with {:ok, y} \u003c- foo(x),\n         {:ok, y} \u003c- foo(y),\n         {:ok, y} \u003c- bar(y) do\n      y\n    end\n  end\n\n  # VS. with Dreamy\n  def with_dreamy(x), do:\n    foo(x)\n    ~\u003e (\u0026foo/1)\n    ~\u003e (\u0026bar/1)\n    |\u003e unwrap()\nend\n```\n\n## Installation\n\n[Available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `dreamy` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:dreamy, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwireman%2Fdreamy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwireman%2Fdreamy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwireman%2Fdreamy/lists"}