Closed darky closed 3 months ago
flatten
unnest nested Action
to one level
Result
analog - https://hexdocs.pm/gleam_stdlib/gleam/result.html#flatten
Option
analog - https://hexdocs.pm/gleam_stdlib/gleam/option.html#flatten
In another FP programming languages sometimes it's called chain
I mean more of a practical use-case that one would typically use this function for. The function itself makes sense.
For example, you use act.map
on some Action
and inside this act.map
you change State
via act/state.set
On result, you receive Action(Action)
and you want unnest it before sending it to next function in pipeline
Ah, that makes sense!
What is this function generally used for? I can't think of anything off the top of my head.