Commit Graph

1838 Commits

Author SHA1 Message Date
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
Jonathan Daugherty
5db48f2820 Initial refactor of EventM to be a state monad (also migrates to mtl) 2022-07-15 17:57:39 -07:00
Jonathan Daugherty
63a4083391 EventTrigger: Static -> ByKey 2022-07-10 13:59:27 -07:00
Jonathan Daugherty
456da00fa9 keyHandlersFromConfig: nit 2022-07-10 13:57:58 -07:00
Jonathan Daugherty
6466c4e99d keyHandlersFromConfig: cleanup 2022-07-10 13:56:41 -07:00
Jonathan Daugherty
6c1f357318 Whitespace 2022-07-10 13:56:29 -07:00
Jonathan Daugherty
3014e79304 Remove stale imports 2022-07-10 13:56:26 -07:00
Jonathan Daugherty
232fcc81b4 Keybindings: re-export Pretty module 2022-07-10 09:50:09 -07:00
Jonathan Daugherty
52a370fad8 Parse: move pretty-printing functions to Pretty 2022-07-10 09:50:02 -07:00
Jonathan Daugherty
04676115e6 Incorporate keybinding machinery from Matterhorn 2022-07-10 09:37:16 -07:00
Jonathan Daugherty
b23c40d82a Editor: mention mouse events in docs 2022-07-09 12:20:44 -07:00
Jonathan Daugherty
1c044013b2 Comment edit 2022-07-09 09:23:36 -07:00
Jonathan Daugherty
034ce2dfbf Bump version, update changelog 2022-07-09 09:23:10 -07:00
Jonathan Daugherty
beebfc7ba4 Changelog: remove merged entry 2022-07-09 09:22:34 -07:00
Jonathan Daugherty
40a39b92d1
Merge pull request #376 from TristanCacqueray/edit-cursor-pos
Add Brick.Widgets.Edit.getCursorPosition
2022-07-09 09:22:13 -07:00
Jonathan Daugherty
4749694d5a Bump version, update changelog 2022-07-09 08:44:05 -07:00
Jonathan Daugherty
c832aef14a Improve editor cursor placement with moveCursorClosest from text-zipper 0.12 2022-07-09 08:40:04 -07:00