Changelog for brick-0.2
Brick changelog
0.2
API changes:
- Added top-level
Brickmodule that re-exports the most important modules in the library. - List:
- Now instead of passing the item-drawing function to the
liststate constructor, it is passed torenderList renderListnow takes the row height of the list's item widgets. The list item-drawing function must respect this in order for scrolling to work properly. This change made it possible to optimize the list so that it only draws widgets visible in the viewport rather than rendering all of the list's items (even the ones off-screen). But to do this we must be able to tell in advance how high each one is, so we require this parameter. In addition this change means that lists no longer support items of different heights.- The list now uses Data.Vector instead of [a] to store items; this permits efficient slicing so we can do the optimized rendering described above.
- Now instead of passing the item-drawing function to the
- The
HandleEventtype classhandleEventmethod now runs inEventM. This permits event-handling code implemented in terms ofHandleEventto do get access to viewport state and to run IO code, making it just as powerful as code in the top-levelEventMhandler. - Many types were moved from
Brick.Widgets.CoreandBrick.MaintoBrick.Types, making the former module merely a home forWidgetconstructors and combinators. - The
IsStringinstance forWidgetwas removed; this might be reinstated later, but this package provides enoughIsStringinstances that things can get confusing. EventMis now reader monad over the most recent rendering pass's viewport state, in addition to being a state monad over viewport requests for the renderer. Added thelookupViewportfunction to provide access to the most recent viewport state. Exported theViewporttype and lenses.- Now that
handleEventis now anEventMaction, composition withcontinueet al got a little messier when using lenses to update the application state. To help with this, there is nowhandleEventLensed.
Bugfixes:
- Lists now perform well with 10 items or a million (see above; fixes #7, thanks Simon Michael)
- Added more haddock notes to
Brick.Widgets.Coreabout growth policies. - Forced evaluation of render states to address a space leak in the renderer (fixes #14, thanks Sebastian Reuße seb@wirrsal.net)
- str: only reference string content that can be shown (eliminates a space leak, fixes #14, thanks Sebastian Reuße seb@wirrsal.net)
Misc:
- Added a makefile for the user guide.
- List: added support for Home and End keys (thanks Simon Michael)
- Viewports: when rendering viewports, scroll requests from
EventMare processed before visibility requests from the rendering process; this reverses this previous order of operations but permits user-supplied event handlers to reset viewports when desired.
Package changes:
- Added
deepseqdependency
0.1
Initial release