packages feed

brick 0.45 → 0.46

raw patch · 6 files changed

+53/−4 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Data.Text.Markup: empty :: Markup a -> Bool
+ Data.Text.Markup: isEmpty :: Markup a -> Bool
- Brick.BorderMap: eBottomL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.BorderMap: eBottomL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.BorderMap: eLeftL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.BorderMap: eLeftL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.BorderMap: eRightL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.BorderMap: eRightL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.BorderMap: eTopL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.BorderMap: eTopL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.Types: bordersL :: forall n_aGcQ. Lens' (Result n_aGcQ) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_aGj7. Lens' (Result n_aGj7) (BorderMap DynBorder)
- Brick.Types: cursorLocationL :: forall n_aERr. Lens' (CursorLocation n_aERr) Location
+ Brick.Types: cursorLocationL :: forall n_aEXI. Lens' (CursorLocation n_aEXI) Location
- Brick.Types: cursorLocationNameL :: forall n_aERr n_aGQ2. Lens (CursorLocation n_aERr) (CursorLocation n_aGQ2) (Maybe n_aERr) (Maybe n_aGQ2)
+ Brick.Types: cursorLocationNameL :: forall n_aEXI n_aGWj. Lens (CursorLocation n_aEXI) (CursorLocation n_aGWj) (Maybe n_aEXI) (Maybe n_aGWj)
- Brick.Types: cursorsL :: forall n_aGcQ. Lens' (Result n_aGcQ) [CursorLocation n_aGcQ]
+ Brick.Types: cursorsL :: forall n_aGj7. Lens' (Result n_aGj7) [CursorLocation n_aGj7]
- Brick.Types: eBottomL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.Types: eBottomL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.Types: eLeftL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.Types: eLeftL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.Types: eRightL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.Types: eRightL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.Types: eTopL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
+ Brick.Types: eTopL :: forall a_ajaQ. Lens' (Edges a_ajaQ) a_ajaQ
- Brick.Types: extentsL :: forall n_aGcQ. Lens' (Result n_aGcQ) [Extent n_aGcQ]
+ Brick.Types: extentsL :: forall n_aGj7. Lens' (Result n_aGj7) [Extent n_aGj7]
- Brick.Types: imageL :: forall n_aGcQ. Lens' (Result n_aGcQ) Image
+ Brick.Types: imageL :: forall n_aGj7. Lens' (Result n_aGj7) Image
- Brick.Types: visibilityRequestsL :: forall n_aGcQ. Lens' (Result n_aGcQ) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aGj7. Lens' (Result n_aGj7) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1gaR a_a1gby. Lens (Dialog a_a1gaR) (Dialog a_a1gby) [(String, a_a1gaR)] [(String, a_a1gby)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1gjJ a_a1gkq. Lens (Dialog a_a1gjJ) (Dialog a_a1gkq) [(String, a_a1gjJ)] [(String, a_a1gkq)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1gaR. Lens' (Dialog a_a1gaR) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1gjJ. Lens' (Dialog a_a1gjJ) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1gaR. Lens' (Dialog a_a1gaR) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1gjJ. Lens' (Dialog a_a1gjJ) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1gaR. Lens' (Dialog a_a1gaR) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1gjJ. Lens' (Dialog a_a1gjJ) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a1be0 n_a1be1 t_a1beK. Lens (Editor t_a1be0 n_a1be1) (Editor t_a1beK n_a1be1) (TextZipper t_a1be0) (TextZipper t_a1beK)
+ Brick.Widgets.Edit: editContentsL :: forall t_a1bmS n_a1bmT t_a1bnC. Lens (Editor t_a1bmS n_a1bmT) (Editor t_a1bnC n_a1bmT) (TextZipper t_a1bmS) (TextZipper t_a1bnC)
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1qC2. Lens' (FileBrowser n_a1qC2) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1qKW. Lens' (FileBrowser n_a1qKW) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1qC2. Lens' (FileBrowser n_a1qC2) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1qKW. Lens' (FileBrowser n_a1qKW) (FileInfo -> Bool)
- Brick.Widgets.List: listElementsL :: forall n_a1lc8 t_a1lc9 e_a1lca t_a1lr6 e_a1lr7. Lens (GenericList n_a1lc8 t_a1lc9 e_a1lca) (GenericList n_a1lc8 t_a1lr6 e_a1lr7) (t_a1lc9 e_a1lca) (t_a1lr6 e_a1lr7)
+ Brick.Widgets.List: listElementsL :: forall n_a1ll0 t_a1ll1 e_a1ll2 t_a1lzY e_a1lzZ. Lens (GenericList n_a1ll0 t_a1ll1 e_a1ll2) (GenericList n_a1ll0 t_a1lzY e_a1lzZ) (t_a1ll1 e_a1ll2) (t_a1lzY e_a1lzZ)
- Brick.Widgets.List: listItemHeightL :: forall n_a1lc8 t_a1lc9 e_a1lca. Lens' (GenericList n_a1lc8 t_a1lc9 e_a1lca) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1ll0 t_a1ll1 e_a1ll2. Lens' (GenericList n_a1ll0 t_a1ll1 e_a1ll2) Int
- Brick.Widgets.List: listNameL :: forall n_a1lc8 t_a1lc9 e_a1lca n_a1lr8. Lens (GenericList n_a1lc8 t_a1lc9 e_a1lca) (GenericList n_a1lr8 t_a1lc9 e_a1lca) n_a1lc8 n_a1lr8
+ Brick.Widgets.List: listNameL :: forall n_a1ll0 t_a1ll1 e_a1ll2 n_a1lA0. Lens (GenericList n_a1ll0 t_a1ll1 e_a1ll2) (GenericList n_a1lA0 t_a1ll1 e_a1ll2) n_a1ll0 n_a1lA0
- Brick.Widgets.List: listSelectedL :: forall n_a1lc8 t_a1lc9 e_a1lca. Lens' (GenericList n_a1lc8 t_a1lc9 e_a1lca) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1ll0 t_a1ll1 e_a1ll2. Lens' (GenericList n_a1ll0 t_a1ll1 e_a1ll2) (Maybe Int)

Files

CHANGELOG.md view
@@ -2,6 +2,20 @@ Brick changelog --------------- +0.46+----++Performance improvements:+ * The box combinators `<=>`, `<+>`, `vBox`, and `hBox` got GHC rewrite+   rules that will optimize away redundant boxes. This change improves+   performance for chains of `<+>` or `<=>` as well as nested boxes+   using `hBox` and `vBox`. Previously chains of e.g. `<+>` produced+   binary trees of boxes that incurred more rendering overhead. Those+   are now optimized away.++API changes:+ * Data.Text.Markup: renamed `empty` to `isEmpty`+ 0.45 ---- 
README.md view
@@ -69,6 +69,7 @@  * `towerHanoi`, animated solutions to The Tower of Hanoi: https://github.com/shajenM/projects/tree/master/towerHanoi  * `VOIDSPACE`, a space-themed typing-tutor game: https://github.com/ChrisPenner/void-space  * `solitaire`, the card game: https://github.com/ambuc/solitaire+ * `sudoku-tui`, a Sudoku implementation: https://github.com/evanrelf/sudoku-tui  Getting Started ---------------
brick.cabal view
@@ -1,5 +1,5 @@ name:                brick-version:             0.45+version:             0.46 synopsis:            A declarative terminal user interface library description:   Write terminal applications painlessly with 'brick'! You write an
src/Brick/Widgets/Core.hs view
@@ -422,16 +422,20 @@ -- in the specified order (uppermost first). Defers growth policies to -- the growth policies of the contained widgets (if any are greedy, so -- is the box).+{-# NOINLINE vBox #-} vBox :: [Widget n] -> Widget n vBox [] = emptyWidget+vBox [a] = a vBox pairs = renderBox vBoxRenderer pairs  -- | Horizontal box layout: put the specified widgets next to each other -- in the specified order (leftmost first). Defers growth policies to -- the growth policies of the contained widgets (if any are greedy, so -- is the box).+{-# NOINLINE hBox #-} hBox :: [Widget n] -> Widget n hBox [] = emptyWidget+hBox [a] = a hBox pairs = renderBox hBoxRenderer pairs  -- | The process of rendering widgets in a box layout is exactly the@@ -1227,6 +1231,7 @@ -- | Horizontal box layout: put the specified widgets next to each other -- in the specified order. Defers growth policies to the growth policies -- of both widgets.  This operator is a binary version of 'hBox'.+{-# NOINLINE (<+>) #-} (<+>) :: Widget n       -- ^ Left       -> Widget n@@ -1237,9 +1242,21 @@ -- | Vertical box layout: put the specified widgets one above the other -- in the specified order. Defers growth policies to the growth policies -- of both widgets.  This operator is a binary version of 'vBox'.+{-# NOINLINE (<=>) #-} (<=>) :: Widget n       -- ^ Top       -> Widget n       -- ^ Bottom       -> Widget n (<=>) a b = vBox [a, b]++{-# RULES+"baseHbox" forall a b   . a <+> b                 = hBox [a, b]+"hBox2"    forall as bs . hBox [hBox as, hBox bs] = hBox (as ++ bs)+"hboxL"    forall as b  . hBox [hBox as, b]       = hBox (as ++ [b])+"hboxR"    forall a bs  . hBox [a, hBox bs]       = hBox (a : bs)+"baseVbox" forall a b   . a <=> b                 = vBox [a, b]+"vBox2"    forall as bs . vBox [vBox as, vBox bs] = vBox (as ++ bs)+"vboxL"    forall as b  . vBox [vBox as, b]       = vBox (as ++ [b])+"vboxR"    forall a bs  . vBox [a, vBox bs]       = vBox (a : bs)+#-}
src/Brick/Widgets/List.hs view
@@ -9,6 +9,14 @@ {-# LANGUAGE DeriveGeneric #-} -- | This module provides a scrollable list type and functions for -- manipulating and rendering it.+--+-- Note that lenses are provided for direct manipulation purposes, but+-- lenses are *not* safe and should be used with care. (For example,+-- 'listElementsL' permits direct manipulation of the list container+-- without performing bounds checking on the selected index.) If you+-- need a safe API, consider one of the various functions for list+-- manipulation. For example, instead of 'listElementsL', consider+-- 'listReplace'. module Brick.Widgets.List   ( GenericList   , List@@ -265,6 +273,15 @@ -- for drawing and 'listItemHeight'. At most, it will evaluate up to -- element @(i + h + 1)@ where @i@ is the selected index and @h@ is the -- available height.+--+-- Note that this function renders the list with the 'listAttr' as+-- the default attribute and then uses 'listSelectedAttr' as the+-- default attribute for the selected item if the list is not focused+-- or 'listSelectedFocusedAttr' otherwise. This is provided as a+-- convenience so that the item rendering function doesn't have to be+-- concerned with attributes, but if those attributes are undesirable+-- for your purposes, 'forceAttr' can always be used by the item+-- rendering function to ensure that another attribute is used instead. renderList :: (Traversable t, Splittable t, Ord n, Show n)            => (Bool -> e -> Widget n)            -- ^ Rendering function, True for the selected element
src/Data/Text/Markup.hs view
@@ -12,7 +12,7 @@   , fromList   , fromText   , toText-  , empty+  , isEmpty   , (@@)   ) where@@ -54,8 +54,8 @@ toText = T.concat . (fst <$>) . concat . markupToList  -- | Test whether the markup is empty.-empty :: Markup a -> Bool-empty (Markup ls) = null ls+isEmpty :: Markup a -> Bool+isEmpty (Markup ls) = null ls  -- | Set the metadata for a range of character positions in a piece of -- markup. This is useful for, e.g., syntax highlighting.