This isn't a fully backwards-compatible change, but the only thing
that needs to be modified for programs involves adding a type parameter,
which will be either `String` or `Text`.
This experimental change makes it possible to:
* Avoid runtime errors due to name typos
* Achieve compile-time guarantees about name matching and usage
* Force widget functions to be name-agnostic by being polymorphic
in their name type
* Clean up focus handling by making it possible to pattern-match
on cursor location names
The change also made many types more heavyweight and in some cases
this is unpleasant when we don't want to have to care about names.
But in those cases we can just use 'n' or '()' depending on how
concrete we need to be. I'm not yet sure how this is going to play
out in practice.
This might improve the understanding of what is a list item and what
is a position. Also in when running the demo it was possible to create
identical items by removing an element form the middle and adding a
new one (wich got the number (length of list), not (smallest unused
element in list)).
instance for Widget
- This makes the module layout more predictable since Brick.Widgets.Core
now (mostly) only contains widgets and widget transformations
- Utility functions closely related to types are now in Brick.Types
- Brick.Types.Internal contains types used internal by the renderer,
some are re-exported by Brick.Types
- Changes renderList to expect an item height and all rendered items
must match this height
- Uses vector slicing to efficiently get the sub-list of items to be
rendered
- Renders 2 * H items at time instead of all N, where H is the height of
the list's viewport
- Changes the editor constructor to take a line limit
- Changes the editor drawing function to take [String] instead of String
- Changes the editor to use a viewport that scrolls both horizontally
and vertically
- Uses the latest text-zipper release (so cabal update)