From 7bba8d28edc1de79975a6a1c2c374d58fb13de8c Mon Sep 17 00:00:00 2001 From: Sebastian Probst Eide Date: Tue, 3 Jan 2017 09:31:46 +0100 Subject: [PATCH 1/2] Slight tweak to Lens.root doc --- lib/lens.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/lens.ex b/lib/lens.ex index b24afe3..3001c8a 100644 --- a/lib/lens.ex +++ b/lib/lens.ex @@ -17,12 +17,14 @@ defmodule Lens do end @doc ~S""" - Returns a lens that focuses on the whole data. + Returns a lens that focuses on all of the data in the given scope. iex> Lens.to_list(Lens.root, :data) [:data] iex> Lens.map(Lens.root, :data, fn :data -> :other_data end) :other_data + iex> Lens.key(:a) |> Lens.both(Lens.root, Lens.key(:b)) |> Lens.to_list(%{a: %{b: 1}}) + [%{b: 1}, 1] """ @spec root :: t deflens_raw root do From 37aa70d2513c2b9f57ff15ed43dd15e6a2b5c9dd Mon Sep 17 00:00:00 2001 From: Sebastian Probst Eide Date: Wed, 4 Jan 2017 14:18:59 +0100 Subject: [PATCH 2/2] Improve wording of function description --- lib/lens.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lens.ex b/lib/lens.ex index 3001c8a..7bb5c4c 100644 --- a/lib/lens.ex +++ b/lib/lens.ex @@ -17,7 +17,7 @@ defmodule Lens do end @doc ~S""" - Returns a lens that focuses on all of the data in the given scope. + Returns a lens that yields the entirety of the data currently under focus. iex> Lens.to_list(Lens.root, :data) [:data]