Use listSelectedElementL to simplify the implementation and improve
asymptotics of some list functions. Introduces some additional
constraints on these functions, so this change requires a major
version bump.
- `listModify`: Improved asymptotics for `Seq`. Introduces
`Splittable` and `Semigroup` constraint.
- `listSelectedElement`: Simpler definition. Asymptotics unchanged.
Introduces `Semigroup` constraint and strengthens `Foldable`
constraint to `Traversable`.
Add a `Traversal` that targets the selected element (if any). It is
useful for retrieving, setting, modifying or traversing the selected
element and composes with other optics. Asymptotics are documented.
It also makes it possible to rewrite some other functions in terms
of `listSelectedElementL`, including:
- `listModify`: Improved asymptotics for some containers, including
`Seq`. Introduces `Splittable` and `Semigroup` constraint.
- `listSelectedElement`: Simplifies definition. Asymptotics
unchanged. Introduces `Semigroup` constraint.
Such changes are left for discussion of possible subsequent
implementation.
This change makes it possible to use the "zoom" function from
microlens-mtl to zoom in on a state field in EventM. This change adds a
re-export of "zoom" to Brick.Types for convenience.
This change refactors the internal book-keeping for the Vty context (Vty
handle, event forwarding thread, and Vty builder) so that we could get
rid of the InternalHalt / InternalSuspendAndResume mess. This change
also made suspendAndResume immediate rather than deferring the
suspension of Vty until after the event handler terminated. This may
have important consequences for applications that assumed the function
was not immediate. Now, it will *immediately* shut down the Vty context
and execute the specified action. This leads to a more natural and sane
behavior.
This change also introduced a more generic
"Brick.Main.suspendAndResume'" function that can execute any IO action
and return its result, which is useful when you want to do some work
that has nothing specifically to do with the EventM state type.