Commit Graph

1854 Commits

Author SHA1 Message Date
Jonathan Daugherty
b7be977d33 KeyEvents: add documentation 2022-08-01 11:35:16 -07:00
Jonathan Daugherty
57679a8f71 newKeyConfig: use a more natural argument ordering 2022-08-01 11:34:59 -07:00
Jonathan Daugherty
5f35cd0e3e KeyConfig: more documentation improvements 2022-08-01 11:29:18 -07:00
Jonathan Daugherty
d83b5eae94 ToBinding: improve description 2022-08-01 11:25:55 -07:00
Jonathan Daugherty
8a3ea98284 KeyConfig: remove redundant key and char functions, improve modifier internals 2022-08-01 11:25:08 -07:00
Jonathan Daugherty
7651cdd546 KeyConfig: add more documentation 2022-08-01 11:22:05 -07:00
Jonathan Daugherty
d81ce60ffb allActiveBindings: only return default bindings when an event has no configured bindings and has not been set to Unbound 2022-08-01 11:06:05 -07:00
Jonathan Daugherty
eedd503cf2 KeyConfig: make active/default binding query functions symmetric 2022-07-28 19:03:55 -07:00
Jonathan Daugherty
c9963d0429 renderRadio: remove unnecessary hBox 2022-07-28 18:43:26 -07:00
Jonathan Daugherty
db98ec8a73 Merge branch 'master' into refactor/event-state-monad 2022-07-28 18:37:03 -07:00
Jonathan Daugherty
79134f8150
Merge pull request #383 from frasertweedale/refactor/list
refactor some list functions (use listSelectedElementL)
2022-07-28 18:36:40 -07:00
Jonathan Daugherty
23fc05e180 Whitespace 2022-07-28 18:31:52 -07:00
Jonathan Daugherty
02c9acfe64 Forms: style nit 2022-07-28 18:31:18 -07:00
Jonathan Daugherty
e8ed13ee42 Forms: suppress unused lens warning 2022-07-28 18:29:25 -07:00
Fraser Tweedale
6dc25d7904 refactor some list functions
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`.
2022-07-29 11:25:26 +10:00
Jonathan Daugherty
f1d510f83b Merge branch 'master' into refactor/event-state-monad 2022-07-28 18:16:09 -07:00
Jonathan Daugherty
a46e4520f3
Merge pull request #381 from avh4/patch-1
Update documentation for wide character support
2022-07-28 13:23:29 -07:00
Jonathan Daugherty
0385fa8e07 tests/List.hs: make Semigroup import conditional 2022-07-28 13:10:15 -07:00
Jonathan Daugherty
408129d825 tests/List.hs: style 2022-07-28 13:09:01 -07:00
Jonathan Daugherty
dd8958fc45 listSelectedElementL: style 2022-07-28 13:02:53 -07:00
Jonathan Daugherty
1d8e0832d1
Merge pull request #382 from frasertweedale/feature/selected-element-traversal
add listSelectedElementL Traversal
2022-07-28 09:27:55 -07:00
Fraser Tweedale
896e7243ef add listSelectedElementL Traversal
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.
2022-07-28 23:34:32 +10:00
Aaron VonderHaar
8baa49f29b Update documentation on wide character support to clarify the current recommendation 2022-07-27 21:03:46 -07:00
Jonathan Daugherty
dee90efa8c Remove withLens and withFirst in lieu of a Zoom instance for EventM
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.
2022-07-26 19:49:29 -07:00
Jonathan Daugherty
e0c70f070a API changes: get rid of InternalSuspendAndResume, make suspendAndResume immediate
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.
2022-07-26 19:03:47 -07:00
Jonathan Daugherty
0b6b562821 Fix comment 2022-07-26 08:56:48 -07:00
Aaron VonderHaar
936d166290
Update documentation for wide character support 2022-07-25 23:30:53 -07:00
Jonathan Daugherty
34f77c4bb7 Comment nit 2022-07-24 07:39:52 -07:00
Jonathan Daugherty
55b95d740b Merge branch 'refactor/event-state-monad' of github.com:jtdaugherty/brick into refactor/event-state-monad 2022-07-24 07:38:36 -07:00
Jonathan Daugherty
3a6f130756 Brick.Types: add nestEventM' and withFirst 2022-07-24 07:38:30 -07:00
Jonathan Daugherty
bf2f6be870 Move Padding type from Brick.Types to Brick.Widgets.Core 2022-07-22 16:07:00 -07:00
Jonathan Daugherty
f2b2586d53 Comment edit 2022-07-22 15:50:06 -07:00
Jonathan Daugherty
b0273b0109 MouseDemo: move Vty handle operations into appStartEvent 2022-07-21 14:22:11 -07:00
Jonathan Daugherty
2838263c22 MouseDemo: whitespace 2022-07-21 14:18:49 -07:00
Jonathan Daugherty
84924f41c1 Docstring edit 2022-07-17 19:08:02 -07:00
Jonathan Daugherty
241b599fd2 Whitespace 2022-07-17 19:07:49 -07:00
Jonathan Daugherty
40f37f62a0 withLens, nestEventM: add docs 2022-07-17 19:06:00 -07:00
Jonathan Daugherty
293ba9ceba Move EventM from Brick.Types to Brick.Types.EventM, stop exporting internals of EventM 2022-07-17 19:03:29 -07:00
Jonathan Daugherty
83015ff1ac Forms: update docs 2022-07-17 18:51:02 -07:00
Jonathan Daugherty
875c305ad4 handleEventLensed -> withLens (generalize API), add nestEventM 2022-07-17 16:50:54 -07:00
Jonathan Daugherty
d0ffb6fbf4 Extent, Result: make fields strict 2022-07-17 09:31:43 -07:00
Jonathan Daugherty
312b7f8391 Whitespace 2022-07-17 09:28:16 -07:00
Jonathan Daugherty
301015a930 EventState: make fields strict 2022-07-17 09:26:46 -07:00
Jonathan Daugherty
4297ca073e Stale import 2022-07-17 09:26:34 -07:00
Jonathan Daugherty
49797717ab Use strict state monad everywhere we use a state monad 2022-07-17 09:25:13 -07:00
Jonathan Daugherty
f2f8013d63 Types: re-export state monad functions as part of API 2022-07-16 23:17:45 -07:00
Jonathan Daugherty
a5b3240758 Hide state type variable in ViewportScroll to avoid unnecessary API change 2022-07-16 23:13:37 -07:00
Jonathan Daugherty
4ea1f65d86 Update demo programs for changes to EventM 2022-07-16 23:10:03 -07:00
Jonathan Daugherty
aa07f9eaee Finish most proof of concept internals updates for EventM changes 2022-07-16 23:09:51 -07:00
Jonathan Daugherty
74ba7b6c56 Add updateWithLens, finish FileBrowser updates 2022-07-16 13:28:47 -07:00