You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
la = Lens.make_lens("a")
lb = Lens.make_lens("b")
i0 = Lens.idx(0)
This works
la ~> i0 ~> lb |> Lens.safe_view(%{"a" => [%{"b" => 3}]})
This crashes
la ~> i0 ~> lb |> Lens.safe_view(%{"a" => []})
** (FunctionClauseError) no function clause matching in Keyword.get/3
(elixir) lib/keyword.ex:150: Keyword.get([], 0, nil)
lib/focus.ex:147: anonymous fn/3 in Focus.compose/2
Shouldn't "safe_view" be safe and not crash when something is missing?
The text was updated successfully, but these errors were encountered:
la = Lens.make_lens("a")
lb = Lens.make_lens("b")
i0 = Lens.idx(0)
This works
la ~> i0 ~> lb |> Lens.safe_view(%{"a" => [%{"b" => 3}]})
This crashes
la ~> i0 ~> lb |> Lens.safe_view(%{"a" => []})
** (FunctionClauseError) no function clause matching in Keyword.get/3
(elixir) lib/keyword.ex:150: Keyword.get([], 0, nil)
lib/focus.ex:147: anonymous fn/3 in Focus.compose/2
Shouldn't "safe_view" be safe and not crash when something is missing?
The text was updated successfully, but these errors were encountered: