Hello community, here is the log from the commit of package ghc-brick for openSUSE:Factory checked in at 2017-08-31 20:50:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-brick (Old) and /work/SRC/openSUSE:Factory/.ghc-brick.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-brick" Thu Aug 31 20:50:19 2017 rev:3 rq:513216 version:0.18 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-brick/ghc-brick.changes 2017-05-03 15:55:56.370819222 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-brick.new/ghc-brick.changes 2017-08-31 20:50:19.987079458 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:08:10 UTC 2017 - [email protected] + +- Update to version 0.18. + +------------------------------------------------------------------- Old: ---- brick-0.17.2.tar.gz New: ---- brick-0.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-brick.spec ++++++ --- /var/tmp/diff_new_pack.4ZV2Cy/_old 2017-08-31 20:50:21.266899809 +0200 +++ /var/tmp/diff_new_pack.4ZV2Cy/_new 2017-08-31 20:50:21.266899809 +0200 @@ -18,7 +18,7 @@ %global pkg_name brick Name: ghc-%{pkg_name} -Version: 0.17.2 +Version: 0.18 Release: 0 Summary: A declarative terminal user interface library License: BSD-3-Clause @@ -28,6 +28,7 @@ BuildRequires: ghc-Cabal-devel BuildRequires: ghc-containers-devel BuildRequires: ghc-contravariant-devel +BuildRequires: ghc-data-clist-devel BuildRequires: ghc-deepseq-devel BuildRequires: ghc-dlist-devel BuildRequires: ghc-microlens-devel ++++++ brick-0.17.2.tar.gz -> brick-0.18.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/CHANGELOG.md new/brick-0.18/CHANGELOG.md --- old/brick-0.17.2/CHANGELOG.md 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/CHANGELOG.md 2017-06-11 21:27:52.000000000 +0200 @@ -2,6 +2,20 @@ Brick changelog --------------- +0.18 +---- + +Package changes: + * Added a dependency on data-clist. + +API changes: + * Brick.Focus: removed the Functor instance for FocusRing. + * Brick.Focus: re-implemented FocusRing in terms of the circular list + data structure from data-clist. In addition, this change introduced + "focusRingModify", which permits the user to use the data-clist API + to directly manipulate the FocusRing's internals. This way brick + doesn't have to re-invent the wheel on the focus ring behavior. + 0.17.2 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/README.md new/brick-0.18/README.md --- old/brick-0.17.2/README.md 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/README.md 2017-06-11 21:27:52.000000000 +0200 @@ -25,8 +25,7 @@ Example ------- -Here's an example interface that resizes automatically when the terminal -size changes (see `programs/ReadmeDemo.hs`): +Here's an example interface (see `programs/ReadmeDemo.hs`): ``` withBorderStyle unicode $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/brick.cabal new/brick-0.18/brick.cabal --- old/brick-0.17.2/brick.cabal 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/brick.cabal 2017-06-11 21:27:52.000000000 +0200 @@ -1,5 +1,5 @@ name: brick -version: 0.17.2 +version: 0.18 synopsis: A declarative terminal user interface library description: Write terminal applications painlessly with 'brick'! You write an @@ -81,6 +81,7 @@ build-depends: base <= 5, vty >= 5.15, transformers, + data-clist >= 0.1, dlist, containers, microlens >= 0.3.0.0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/src/Brick/Focus.hs new/brick-0.18/src/Brick/Focus.hs --- old/brick-0.17.2/src/Brick/Focus.hs 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/src/Brick/Focus.hs 2017-06-11 21:27:52.000000000 +0200 @@ -1,5 +1,3 @@ -{-# LANGUAGE DeriveFunctor #-} - -- | This module provides a type and functions for handling focus rings -- of widgets. Note that this interface is merely provided for managing -- the focus state for a sequence of resource names; it does not do @@ -14,41 +12,36 @@ , focusGetCurrent , focusRingCursor , withFocusRing + , focusRingModify ) where import Lens.Micro ((^.)) import Data.Maybe (listToMaybe) +import qualified Data.CircularList as C import Brick.Types import Brick.Widgets.Core (Named(..)) -- | A focus ring containing a sequence of resource names to focus and a -- currently-focused name. -data FocusRing n = FocusRingEmpty - | FocusRingNonempty ![n] !Int - deriving Functor +newtype FocusRing n = FocusRing (C.CList n) -- | Construct a focus ring from the list of resource names. focusRing :: [n] -> FocusRing n -focusRing [] = FocusRingEmpty -focusRing names = FocusRingNonempty names 0 +focusRing = FocusRing . C.fromList -- | Advance focus to the next widget in the ring. focusNext :: FocusRing n -> FocusRing n -focusNext FocusRingEmpty = FocusRingEmpty -focusNext fr@(FocusRingNonempty [_] _) = fr -focusNext (FocusRingNonempty ns i) = FocusRingNonempty ns i' - where - i' = (i + 1) `mod` (length ns) +focusNext r@(FocusRing l) + | C.isEmpty l = r + | otherwise = FocusRing $ C.rotR l -- | Advance focus to the previous widget in the ring. focusPrev :: FocusRing n -> FocusRing n -focusPrev FocusRingEmpty = FocusRingEmpty -focusPrev fr@(FocusRingNonempty [_] _) = fr -focusPrev (FocusRingNonempty ns i) = FocusRingNonempty ns i' - where - i' = (i + (length ns) - 1) `mod` (length ns) +focusPrev r@(FocusRing l) + | C.isEmpty l = r + | otherwise = FocusRing $ C.rotL l -- | This function is a convenience function to look up a widget state -- value's resource name in a focus ring and set its focus setting @@ -74,8 +67,13 @@ -- | Get the currently-focused resource name from the ring. If the ring -- is emtpy, return 'Nothing'. focusGetCurrent :: FocusRing n -> Maybe n -focusGetCurrent FocusRingEmpty = Nothing -focusGetCurrent (FocusRingNonempty ns i) = Just $ ns !! i +focusGetCurrent (FocusRing l) = C.focus l + +-- | Modify the internal circular list structure of a focus ring +-- directly. This function permits modification of the circular list +-- using the rich Data.CircularList API. +focusRingModify :: (C.CList n -> C.CList n) -> FocusRing n -> FocusRing n +focusRingModify f (FocusRing l) = FocusRing $ f l -- | Cursor selection convenience function for use as an -- 'Brick.Main.appChooseCursor' value. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/src/Brick/Types/Internal.hs new/brick-0.18/src/Brick/Types/Internal.hs --- old/brick-0.17.2/src/Brick/Types/Internal.hs 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/src/Brick/Types/Internal.hs 2017-06-11 21:27:52.000000000 +0200 @@ -206,7 +206,7 @@ -- ^ A mouse-down event on the specified region was -- received. | MouseUp n (Maybe Button) Location - -- ^ A mouse-down event on the specified region was + -- ^ A mouse-up event on the specified region was -- received. deriving (Show, Eq) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/src/Brick/Widgets/Dialog.hs new/brick-0.18/src/Brick/Widgets/Dialog.hs --- old/brick-0.17.2/src/Brick/Widgets/Dialog.hs 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/src/Brick/Widgets/Dialog.hs 2017-06-11 21:27:52.000000000 +0200 @@ -44,16 +44,14 @@ import Brick.AttrMap -- | Dialogs present a window with a title (optional), a body, and --- buttons (optional). They provide a 'HandleEvent' instance that knows --- about Tab and Shift-Tab as well as ArrowLeft and ArrowRight --- for changing which button is active. Dialog --- buttons are labeled with strings and map to values of type 'a', which --- you choose. +-- buttons (optional). Dialog buttons are labeled with strings and map +-- to values of type 'a', which you choose. -- --- Dialogs handle the following events by default: +-- Dialogs handle the following events by default with +-- handleDialogEvent: -- --- * Tab: selecte the next button --- * Shift-tab: select the previous button +-- * Tab or Right Arrow: select the next button +-- * Shift-tab or Left Arrow: select the previous button data Dialog a = Dialog { dialogTitle :: Maybe String -- ^ The dialog title diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/brick-0.17.2/src/Brick/Widgets/Edit.hs new/brick-0.18/src/Brick/Widgets/Edit.hs --- old/brick-0.17.2/src/Brick/Widgets/Edit.hs 2017-03-12 05:34:36.000000000 +0100 +++ new/brick-0.18/src/Brick/Widgets/Edit.hs 2017-06-11 21:27:52.000000000 +0200 @@ -8,9 +8,9 @@ -- of the editor, just use 'getEditContents'. To modify it, use the -- 'Z.TextZipper' interface with 'applyEdit'. -- --- The editor's 'HandleEvent' instance handles a set of basic input --- events that should suffice for most purposes; see the source for a --- complete list. +-- The editor's 'handleEditorEvent' function handles a set of basic +-- input events that should suffice for most purposes; see the source +-- for a complete list. -- -- Bear in mind that the editor provided by this module is intended to -- provide basic input support for brick applications but it is not
