brick 0.41.3 → 0.41.4
raw patch · 7 files changed
+25/−7 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Brick.AttrMap: instance Control.DeepSeq.NFData Brick.AttrMap.AttrMap
+ Brick.AttrMap: instance Control.DeepSeq.NFData Brick.AttrMap.AttrName
+ Brick.Forms: setFormFocus :: Eq n => n -> Form s e n -> Form s e n
+ Brick.Themes: instance Control.DeepSeq.NFData Brick.Themes.CustomAttr
+ Brick.Themes: instance Control.DeepSeq.NFData Brick.Themes.Theme
+ Brick.Themes: instance Control.DeepSeq.NFData Brick.Themes.ThemeDocumentation
- Brick.BorderMap: eBottomL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.BorderMap: eBottomL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.BorderMap: eLeftL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.BorderMap: eLeftL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.BorderMap: eRightL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.BorderMap: eRightL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.BorderMap: eTopL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.BorderMap: eTopL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.Types: bordersL :: forall n_aEv7. Lens' (Result n_aEv7) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_aGb3. Lens' (Result n_aGb3) (BorderMap DynBorder)
- Brick.Types: cursorLocationL :: forall n_aD9F. Lens' (CursorLocation n_aD9F) Location
+ Brick.Types: cursorLocationL :: forall n_aEPE. Lens' (CursorLocation n_aEPE) Location
- Brick.Types: cursorLocationNameL :: forall n_aD9F n_aF8j. Lens (CursorLocation n_aD9F) (CursorLocation n_aF8j) (Maybe n_aD9F) (Maybe n_aF8j)
+ Brick.Types: cursorLocationNameL :: forall n_aEPE n_aGOf. Lens (CursorLocation n_aEPE) (CursorLocation n_aGOf) (Maybe n_aEPE) (Maybe n_aGOf)
- Brick.Types: cursorsL :: forall n_aEv7. Lens' (Result n_aEv7) [CursorLocation n_aEv7]
+ Brick.Types: cursorsL :: forall n_aGb3. Lens' (Result n_aGb3) [CursorLocation n_aGb3]
- Brick.Types: eBottomL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.Types: eBottomL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.Types: eLeftL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.Types: eLeftL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.Types: eRightL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.Types: eRightL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.Types: eTopL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
+ Brick.Types: eTopL :: forall a_aj4U. Lens' (Edges a_aj4U) a_aj4U
- Brick.Types: extentsL :: forall n_aEv7. Lens' (Result n_aEv7) [Extent n_aEv7]
+ Brick.Types: extentsL :: forall n_aGb3. Lens' (Result n_aGb3) [Extent n_aGb3]
- Brick.Types: imageL :: forall n_aEv7. Lens' (Result n_aEv7) Image
+ Brick.Types: imageL :: forall n_aGb3. Lens' (Result n_aGb3) Image
- Brick.Types: visibilityRequestsL :: forall n_aEv7. Lens' (Result n_aEv7) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aGb3. Lens' (Result n_aGb3) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1et8 a_a1etP. Lens (Dialog a_a1et8) (Dialog a_a1etP) [(String, a_a1et8)] [(String, a_a1etP)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1g94 a_a1g9L. Lens (Dialog a_a1g94) (Dialog a_a1g9L) [(String, a_a1g94)] [(String, a_a1g9L)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1et8. Lens' (Dialog a_a1et8) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1g94. Lens' (Dialog a_a1g94) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1et8. Lens' (Dialog a_a1et8) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1g94. Lens' (Dialog a_a1g94) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1et8. Lens' (Dialog a_a1et8) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1g94. Lens' (Dialog a_a1g94) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a19wh n_a19wi t_a19x1. Lens (Editor t_a19wh n_a19wi) (Editor t_a19x1 n_a19wi) (TextZipper t_a19wh) (TextZipper t_a19x1)
+ Brick.Widgets.Edit: editContentsL :: forall t_a1bcd n_a1bce t_a1bcX. Lens (Editor t_a1bcd n_a1bce) (Editor t_a1bcX n_a1bce) (TextZipper t_a1bcd) (TextZipper t_a1bcX)
- Brick.Widgets.List: listElementsL :: forall n_a1jqz e_a1jqA e_a1jDr. Lens (List n_a1jqz e_a1jqA) (List n_a1jqz e_a1jDr) (Vector e_a1jqA) (Vector e_a1jDr)
+ Brick.Widgets.List: listElementsL :: forall n_a1l6v e_a1l6w e_a1ljn. Lens (List n_a1l6v e_a1l6w) (List n_a1l6v e_a1ljn) (Vector e_a1l6w) (Vector e_a1ljn)
- Brick.Widgets.List: listItemHeightL :: forall n_a1jqz e_a1jqA. Lens' (List n_a1jqz e_a1jqA) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1l6v e_a1l6w. Lens' (List n_a1l6v e_a1l6w) Int
- Brick.Widgets.List: listNameL :: forall n_a1jqz e_a1jqA n_a1jDs. Lens (List n_a1jqz e_a1jqA) (List n_a1jDs e_a1jqA) n_a1jqz n_a1jDs
+ Brick.Widgets.List: listNameL :: forall n_a1l6v e_a1l6w n_a1ljo. Lens (List n_a1l6v e_a1l6w) (List n_a1ljo e_a1l6w) n_a1l6v n_a1ljo
- Brick.Widgets.List: listSelectedL :: forall n_a1jqz e_a1jqA. Lens' (List n_a1jqz e_a1jqA) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1l6v e_a1l6w. Lens' (List n_a1l6v e_a1l6w) (Maybe Int)
Files
- CHANGELOG.md +8/−0
- README.md +1/−0
- brick.cabal +1/−1
- programs/MouseDemo.hs +1/−1
- src/Brick/AttrMap.hs +4/−2
- src/Brick/Forms.hs +5/−0
- src/Brick/Themes.hs +5/−3
CHANGELOG.md view
@@ -2,6 +2,14 @@ Brick changelog --------------- +0.41.4+------++API changes:+ * Forms: added `setFormFocus` function to set focus for a form+ * Added `NFData` instances for `AttrMap` and `Theme` types (thanks+ Fraser Tweedale)+ 0.41.3 ------
README.md view
@@ -67,6 +67,7 @@ * `bhoogle`, a [Hoogle](https://www.haskell.org/hoogle/) client: https://github.com/andrevdm/bhoogle * `clifm`, a file manager: https://github.com/pasqu4le/clifm * `towerHanoi`, animated solutions to The Tower of Hanoi: https://github.com/shajenM/projects/tree/master/towerHanoi+ * [`VOIDSPACE`](https://github.com/ChrisPenner/void-space), fight off scary category theory terms in this space-themed typing-tutor game: https://github.com/ChrisPenner/void-space Getting Started ---------------
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 0.41.3+version: 0.41.4 synopsis: A declarative terminal user interface library description: Write terminal applications painlessly with 'brick'! You write an
programs/MouseDemo.hs view
@@ -124,7 +124,7 @@ return v void $ M.customMain buildVty Nothing app $ St [] Nothing- "Press Ctrl-up and Ctrl-down arrow keys to scroll, ESC to quit.\n\+ "Try clicking on various UI elements.\n\ \Observe that the click coordinates identify the\n\ \underlying widget coordinates.\n\ \\n\
src/Brick/AttrMap.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} -- | This module provides types and functions for managing an attribute -- map which maps attribute names ('AttrName') to attributes ('Attr').@@ -51,6 +52,7 @@ import qualified Data.Semigroup as Sem +import Control.DeepSeq import qualified Data.Map as M import Data.Maybe (catMaybes) import Data.List (inits)@@ -72,7 +74,7 @@ -- "header" <> "clock" <> "seconds" -- @ data AttrName = AttrName [String]- deriving (Show, Read, Eq, Ord, Generic)+ deriving (Show, Read, Eq, Ord, Generic, NFData) instance Sem.Semigroup AttrName where (AttrName as) <> (AttrName bs) = AttrName $ as `mappend` bs@@ -87,7 +89,7 @@ -- | An attribute map which maps 'AttrName' values to 'Attr' values. data AttrMap = AttrMap Attr (M.Map AttrName Attr) | ForceAttr Attr- deriving (Show, Generic)+ deriving (Show, Generic, NFData) -- | Create an attribute name from a string. attrName :: String -> AttrName
src/Brick/Forms.hs view
@@ -59,6 +59,7 @@ , setFieldValid , setFormConcat , setFieldConcat+ , setFormFocus -- * Simple form field constructors , editTextField@@ -225,6 +226,10 @@ (@@=) h mkFs s = let v = mkFs s in v { formFieldRenderHelper = h . (formFieldRenderHelper v) }++-- | Set the focused field of a form.+setFormFocus :: (Eq n) => n -> Form s e n -> Form s e n+setFormFocus n f = f { formFocus = focusSetCurrent n $ formFocus f } -- | Set a form field's concatenation function. setFieldConcat :: ([Widget n] -> Widget n) -> FormFieldState s e n -> FormFieldState s e n
src/Brick/Themes.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} -- | Support for representing attribute themes and loading and saving@@ -76,6 +77,7 @@ import GHC.Generics (Generic) import Graphics.Vty hiding ((<|>))+import Control.DeepSeq import Control.Monad (forM, join) import Control.Applicative ((<|>)) import qualified Data.Text as T@@ -107,7 +109,7 @@ , customStyle :: Maybe Style -- ^ The customized style, if any. }- deriving (Eq, Read, Show, Generic)+ deriving (Eq, Read, Show, Generic, NFData) instance Sem.Semigroup CustomAttr where a <> b =@@ -127,7 +129,7 @@ -- so e.g. documentation for theme customization -- can be generated mechanically. }- deriving (Eq, Read, Show, Generic)+ deriving (Eq, Read, Show, Generic, NFData) -- | A theme provides a set of default attribute mappings, a default -- attribute, and a set of customizations for the default mapping@@ -151,7 +153,7 @@ -- default mapping; any attributes named here that are not -- present in the default mapping will not be considered. }- deriving (Eq, Read, Show, Generic)+ deriving (Eq, Read, Show, Generic, NFData) suffixLenses ''CustomAttr suffixLenses ''Theme