brick 2.8.3 → 2.9
raw patch · 5 files changed
+41/−6 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Brick.BorderMap: [eTop, eBottom, eLeft, eRight] :: Edges a -> a
- Brick.Types: [eTop, eBottom, eLeft, eRight] :: Edges a -> a
+ Brick.BorderMap: [eBottom] :: Edges a -> a
+ Brick.BorderMap: [eLeft] :: Edges a -> a
+ Brick.BorderMap: [eRight] :: Edges a -> a
+ Brick.BorderMap: [eTop] :: Edges a -> a
+ Brick.Types: [eBottom] :: Edges a -> a
+ Brick.Types: [eLeft] :: Edges a -> a
+ Brick.Types: [eRight] :: Edges a -> a
+ Brick.Types: [eTop] :: Edges a -> a
+ Brick.Widgets.List: listFindFirst :: forall (t :: Type -> Type) e n. (Semigroup (t e), Splittable t, Traversable t) => (e -> Bool) -> GenericList n t e -> Maybe (Int, e)
- Brick.BorderMap: Edges :: a -> Edges a
+ Brick.BorderMap: Edges :: a -> a -> a -> a -> Edges a
- Brick.BorderMap: eBottomL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.BorderMap: eBottomL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.BorderMap: eLeftL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.BorderMap: eLeftL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.BorderMap: eRightL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.BorderMap: eRightL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.BorderMap: eTopL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.BorderMap: eTopL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.Forms: [FormFieldState] :: b -> Lens' s a -> (a -> b -> b) -> [FormField a b e n] -> (Widget n -> Widget n) -> ([Widget n] -> Widget n) -> FormFieldVisibilityMode -> FormFieldState s e n
+ Brick.Forms: [FormFieldState] :: forall b s a e n. b -> Lens' s a -> (a -> b -> b) -> [FormField a b e n] -> (Widget n -> Widget n) -> ([Widget n] -> Widget n) -> FormFieldVisibilityMode -> FormFieldState s e n
- Brick.Keybindings.KeyDispatcher: Handler :: Text -> m () -> Handler m
+ Brick.Keybindings.KeyDispatcher: Handler :: Text -> m () -> Handler (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: KeyEventHandler :: Handler m -> EventTrigger k -> KeyEventHandler k m
+ Brick.Keybindings.KeyDispatcher: KeyEventHandler :: Handler m -> EventTrigger k -> KeyEventHandler k (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: KeyHandler :: KeyEventHandler k m -> Binding -> KeyHandler k m
+ Brick.Keybindings.KeyDispatcher: KeyHandler :: KeyEventHandler k m -> Binding -> KeyHandler k (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: [handlerAction] :: Handler m -> m ()
+ Brick.Keybindings.KeyDispatcher: [handlerAction] :: Handler (m :: Type -> Type) -> m ()
- Brick.Keybindings.KeyDispatcher: [handlerDescription] :: Handler m -> Text
+ Brick.Keybindings.KeyDispatcher: [handlerDescription] :: Handler (m :: Type -> Type) -> Text
- Brick.Keybindings.KeyDispatcher: [kehEventTrigger] :: KeyEventHandler k m -> EventTrigger k
+ Brick.Keybindings.KeyDispatcher: [kehEventTrigger] :: KeyEventHandler k (m :: Type -> Type) -> EventTrigger k
- Brick.Keybindings.KeyDispatcher: [kehHandler] :: KeyEventHandler k m -> Handler m
+ Brick.Keybindings.KeyDispatcher: [kehHandler] :: KeyEventHandler k (m :: Type -> Type) -> Handler m
- Brick.Keybindings.KeyDispatcher: [khBinding] :: KeyHandler k m -> Binding
+ Brick.Keybindings.KeyDispatcher: [khBinding] :: KeyHandler k (m :: Type -> Type) -> Binding
- Brick.Keybindings.KeyDispatcher: [khHandler] :: KeyHandler k m -> KeyEventHandler k m
+ Brick.Keybindings.KeyDispatcher: [khHandler] :: KeyHandler k (m :: Type -> Type) -> KeyEventHandler k m
- Brick.Keybindings.KeyDispatcher: data Handler m
+ Brick.Keybindings.KeyDispatcher: data Handler (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: data KeyDispatcher k m
+ Brick.Keybindings.KeyDispatcher: data KeyDispatcher k (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: data KeyEventHandler k m
+ Brick.Keybindings.KeyDispatcher: data KeyEventHandler k (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: data KeyHandler k m
+ Brick.Keybindings.KeyDispatcher: data KeyHandler k (m :: Type -> Type)
- Brick.Keybindings.KeyDispatcher: keyDispatcher :: Ord k => KeyConfig k -> [KeyEventHandler k m] -> Either [(Binding, [KeyHandler k m])] (KeyDispatcher k m)
+ Brick.Keybindings.KeyDispatcher: keyDispatcher :: forall k (m :: Type -> Type). Ord k => KeyConfig k -> [KeyEventHandler k m] -> Either [(Binding, [KeyHandler k m])] (KeyDispatcher k m)
- Brick.Keybindings.KeyDispatcher: keyDispatcherToList :: KeyDispatcher k m -> [(Binding, KeyHandler k m)]
+ Brick.Keybindings.KeyDispatcher: keyDispatcherToList :: forall k (m :: Type -> Type). KeyDispatcher k m -> [(Binding, KeyHandler k m)]
- Brick.Keybindings.KeyDispatcher: lookupVtyEvent :: Key -> [Modifier] -> KeyDispatcher k m -> Maybe (KeyHandler k m)
+ Brick.Keybindings.KeyDispatcher: lookupVtyEvent :: forall k (m :: Type -> Type). Key -> [Modifier] -> KeyDispatcher k m -> Maybe (KeyHandler k m)
- Brick.Keybindings.Pretty: keybindingHelpWidget :: Ord k => KeyConfig k -> [KeyEventHandler k m] -> Widget n
+ Brick.Keybindings.Pretty: keybindingHelpWidget :: forall k (m :: Type -> Type) n. Ord k => KeyConfig k -> [KeyEventHandler k m] -> Widget n
- Brick.Keybindings.Pretty: keybindingMarkdownTable :: Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
+ Brick.Keybindings.Pretty: keybindingMarkdownTable :: forall k (m :: Type -> Type). Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
- Brick.Keybindings.Pretty: keybindingTextTable :: Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
+ Brick.Keybindings.Pretty: keybindingTextTable :: forall k (m :: Type -> Type). Ord k => KeyConfig k -> [(Text, [KeyEventHandler k m])] -> Text
- Brick.Main: hScrollBy :: ViewportScroll n -> forall s. Int -> EventM n s ()
+ Brick.Main: hScrollBy :: ViewportScroll n -> forall s. () => Int -> EventM n s ()
- Brick.Main: hScrollPage :: ViewportScroll n -> forall s. Direction -> EventM n s ()
+ Brick.Main: hScrollPage :: ViewportScroll n -> forall s. () => Direction -> EventM n s ()
- Brick.Main: hScrollToBeginning :: ViewportScroll n -> forall s. EventM n s ()
+ Brick.Main: hScrollToBeginning :: ViewportScroll n -> forall s. () => EventM n s ()
- Brick.Main: hScrollToEnd :: ViewportScroll n -> forall s. EventM n s ()
+ Brick.Main: hScrollToEnd :: ViewportScroll n -> forall s. () => EventM n s ()
- Brick.Main: setLeft :: ViewportScroll n -> forall s. Int -> EventM n s ()
+ Brick.Main: setLeft :: ViewportScroll n -> forall s. () => Int -> EventM n s ()
- Brick.Main: setTop :: ViewportScroll n -> forall s. Int -> EventM n s ()
+ Brick.Main: setTop :: ViewportScroll n -> forall s. () => Int -> EventM n s ()
- Brick.Main: vScrollBy :: ViewportScroll n -> forall s. Int -> EventM n s ()
+ Brick.Main: vScrollBy :: ViewportScroll n -> forall s. () => Int -> EventM n s ()
- Brick.Main: vScrollPage :: ViewportScroll n -> forall s. Direction -> EventM n s ()
+ Brick.Main: vScrollPage :: ViewportScroll n -> forall s. () => Direction -> EventM n s ()
- Brick.Main: vScrollToBeginning :: ViewportScroll n -> forall s. EventM n s ()
+ Brick.Main: vScrollToBeginning :: ViewportScroll n -> forall s. () => EventM n s ()
- Brick.Main: vScrollToEnd :: ViewportScroll n -> forall s. EventM n s ()
+ Brick.Main: vScrollToEnd :: ViewportScroll n -> forall s. () => EventM n s ()
- Brick.Types: Edges :: a -> Edges a
+ Brick.Types: Edges :: a -> a -> a -> a -> Edges a
- Brick.Types: attrL :: forall r n. Getting r (Context n) Attr
+ Brick.Types: attrL :: Getting r (Context n) Attr
- Brick.Types: availHeightL :: forall n_atyt. Lens' (Context n_atyt) Int
+ Brick.Types: availHeightL :: forall n f. Functor f => (Int -> f Int) -> Context n -> f (Context n)
- Brick.Types: availWidthL :: forall n_atyt. Lens' (Context n_atyt) Int
+ Brick.Types: availWidthL :: forall n f. Functor f => (Int -> f Int) -> Context n -> f (Context n)
- Brick.Types: bordersL :: forall n_atyx. Lens' (Result n_atyx) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n f. Functor f => (BorderMap DynBorder -> f (BorderMap DynBorder)) -> Result n -> f (Result n)
- Brick.Types: ctxAttrMapL :: forall n_atyt. Lens' (Context n_atyt) AttrMap
+ Brick.Types: ctxAttrMapL :: forall n f. Functor f => (AttrMap -> f AttrMap) -> Context n -> f (Context n)
- Brick.Types: ctxAttrNameL :: forall n_atyt. Lens' (Context n_atyt) AttrName
+ Brick.Types: ctxAttrNameL :: forall n f. Functor f => (AttrName -> f AttrName) -> Context n -> f (Context n)
- Brick.Types: ctxBorderStyleL :: forall n_atyt. Lens' (Context n_atyt) BorderStyle
+ Brick.Types: ctxBorderStyleL :: forall n f. Functor f => (BorderStyle -> f BorderStyle) -> Context n -> f (Context n)
- Brick.Types: ctxDynBordersL :: forall n_atyt. Lens' (Context n_atyt) Bool
+ Brick.Types: ctxDynBordersL :: forall n f. Functor f => (Bool -> f Bool) -> Context n -> f (Context n)
- Brick.Types: ctxHScrollBarOrientationL :: forall n_atyt. Lens' (Context n_atyt) (Maybe HScrollBarOrientation)
+ Brick.Types: ctxHScrollBarOrientationL :: forall n f. Functor f => (Maybe HScrollBarOrientation -> f (Maybe HScrollBarOrientation)) -> Context n -> f (Context n)
- Brick.Types: ctxHScrollBarRendererL :: forall n_atyt. Lens' (Context n_atyt) (Maybe (HScrollbarRenderer n_atyt))
+ Brick.Types: ctxHScrollBarRendererL :: forall n f. Functor f => (Maybe (HScrollbarRenderer n) -> f (Maybe (HScrollbarRenderer n))) -> Context n -> f (Context n)
- Brick.Types: ctxVScrollBarOrientationL :: forall n_atyt. Lens' (Context n_atyt) (Maybe VScrollBarOrientation)
+ Brick.Types: ctxVScrollBarOrientationL :: forall n f. Functor f => (Maybe VScrollBarOrientation -> f (Maybe VScrollBarOrientation)) -> Context n -> f (Context n)
- Brick.Types: ctxVScrollBarRendererL :: forall n_atyt. Lens' (Context n_atyt) (Maybe (VScrollbarRenderer n_atyt))
+ Brick.Types: ctxVScrollBarRendererL :: forall n f. Functor f => (Maybe (VScrollbarRenderer n) -> f (Maybe (VScrollbarRenderer n))) -> Context n -> f (Context n)
- Brick.Types: cursorLocationL :: forall n_atyy. Lens' (CursorLocation n_atyy) Location
+ Brick.Types: cursorLocationL :: forall n f. Functor f => (Location -> f Location) -> CursorLocation n -> f (CursorLocation n)
- Brick.Types: cursorLocationNameL :: forall n_atyy n_aw7T. Lens (CursorLocation n_atyy) (CursorLocation n_aw7T) (Maybe n_atyy) (Maybe n_aw7T)
+ Brick.Types: cursorLocationNameL :: forall n1 n2 f. Functor f => (Maybe n1 -> f (Maybe n2)) -> CursorLocation n1 -> f (CursorLocation n2)
- Brick.Types: cursorsL :: forall n_atyx. Lens' (Result n_atyx) [CursorLocation n_atyx]
+ Brick.Types: cursorsL :: forall n f. Functor f => ([CursorLocation n] -> f [CursorLocation n]) -> Result n -> f (Result n)
- Brick.Types: eBottomL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.Types: eBottomL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.Types: eLeftL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.Types: eLeftL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.Types: eRightL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.Types: eRightL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.Types: eTopL :: forall a_afCk. Lens' (Edges a_afCk) a_afCk
+ Brick.Types: eTopL :: forall a f. Functor f => (a -> f a) -> Edges a -> f (Edges a)
- Brick.Types: extentsL :: forall n_atyx. Lens' (Result n_atyx) [Extent n_atyx]
+ Brick.Types: extentsL :: forall n f. Functor f => ([Extent n] -> f [Extent n]) -> Result n -> f (Result n)
- Brick.Types: imageL :: forall n_atyx. Lens' (Result n_atyx) Image
+ Brick.Types: imageL :: forall n f. Functor f => (Image -> f Image) -> Result n -> f (Result n)
- Brick.Types: type RenderM n a = ReaderT (Context n) (State (RenderState n)) a
+ Brick.Types: type RenderM n a = ReaderT Context n State RenderState n a
- Brick.Types: visibilityRequestsL :: forall n_atyx. Lens' (Result n_atyx) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n f. Functor f => ([VisibilityRequest] -> f [VisibilityRequest]) -> Result n -> f (Result n)
- Brick.Types: windowHeightL :: forall n_atyt. Lens' (Context n_atyt) Int
+ Brick.Types: windowHeightL :: forall n f. Functor f => (Int -> f Int) -> Context n -> f (Context n)
- Brick.Types: windowWidthL :: forall n_atyt. Lens' (Context n_atyt) Int
+ Brick.Types: windowWidthL :: forall n f. Functor f => (Int -> f Int) -> Context n -> f (Context n)
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1gAD n_a1gAE a_a1gBB. Lens (Dialog a_a1gAD n_a1gAE) (Dialog a_a1gBB n_a1gAE) [(String, n_a1gAE, a_a1gAD)] [(String, n_a1gAE, a_a1gBB)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a1 n a2 f. Functor f => ([(String, n, a1)] -> f [(String, n, a2)]) -> Dialog a1 n -> f (Dialog a2 n)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1gAD n_a1gAE. Lens' (Dialog a_a1gAD n_a1gAE) (Maybe (Widget n_a1gAE))
+ Brick.Widgets.Dialog: dialogTitleL :: forall a n f. Functor f => (Maybe (Widget n) -> f (Maybe (Widget n))) -> Dialog a n -> f (Dialog a n)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1gAD n_a1gAE. Lens' (Dialog a_a1gAD n_a1gAE) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a n f. Functor f => (Int -> f Int) -> Dialog a n -> f (Dialog a n)
- Brick.Widgets.Edit: editContentsL :: forall t_a19IO n_a19IP t_a19Jz. Lens (Editor t_a19IO n_a19IP) (Editor t_a19Jz n_a19IP) (TextZipper t_a19IO) (TextZipper t_a19Jz)
+ Brick.Widgets.Edit: editContentsL :: forall t1 n t2 f. Functor f => (TextZipper t1 -> f (TextZipper t2)) -> Editor t1 n -> f (Editor t2 n)
- Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (List n_a1sB3 FileInfo)
+ Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n r. Getting r (FileBrowser n) (List n FileInfo)
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n r. Getting r (FileBrowser n) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (Maybe IOException)
+ Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n r. Getting r (FileBrowser n) (Maybe IOException)
- Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) [FileInfo]
+ Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n r. Getting r (FileBrowser n) [FileInfo]
- Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) n_a1sB3
+ Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n r. Getting r (FileBrowser n) n
- Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (Maybe Text)
+ Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n r. Getting r (FileBrowser n) (Maybe Text)
- Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n r. Getting r (FileBrowser n) (FileInfo -> Bool)
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1sB3. Lens' (FileBrowser n_a1sB3) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n f. Functor f => ((FileInfo -> Bool) -> f (FileInfo -> Bool)) -> FileBrowser n -> f (FileBrowser n)
- Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) (Set String)
+ Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n r. Getting r (FileBrowser n) (Set String)
- Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n_a1sB3. SimpleGetter (FileBrowser n_a1sB3) FilePath
+ Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n r. Getting r (FileBrowser n) FilePath
- Brick.Widgets.List: class Reversible t
+ Brick.Widgets.List: class Reversible (t :: Type -> Type)
- Brick.Widgets.List: class Splittable t
+ Brick.Widgets.List: class Splittable (t :: Type -> Type)
- Brick.Widgets.List: data GenericList n t e
+ Brick.Widgets.List: data GenericList n (t :: Type -> Type) e
- Brick.Widgets.List: handleListEvent :: (Foldable t, Splittable t, Ord n) => Event -> EventM n (GenericList n t e) ()
+ Brick.Widgets.List: handleListEvent :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t, Ord n) => Event -> EventM n (GenericList n t e) ()
- Brick.Widgets.List: handleListEventVi :: (Foldable t, Splittable t, Ord n) => (Event -> EventM n (GenericList n t e) ()) -> Event -> EventM n (GenericList n t e) ()
+ Brick.Widgets.List: handleListEventVi :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t, Ord n) => (Event -> EventM n (GenericList n t e) ()) -> Event -> EventM n (GenericList n t e) ()
- Brick.Widgets.List: listClear :: Monoid (t e) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listClear :: forall (t :: Type -> Type) e n. Monoid (t e) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listElementsL :: forall n_a1n8E t_a1n8F e_a1n8G t_a1noi e_a1noj. Lens (GenericList n_a1n8E t_a1n8F e_a1n8G) (GenericList n_a1n8E t_a1noi e_a1noj) (t_a1n8F e_a1n8G) (t_a1noi e_a1noj)
+ Brick.Widgets.List: listElementsL :: forall n t1 e1 t2 e2 f. Functor f => (t1 e1 -> f (t2 e2)) -> GenericList n t1 e1 -> f (GenericList n t2 e2)
- Brick.Widgets.List: listFindBy :: (Foldable t, Splittable t) => (e -> Bool) -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listFindBy :: forall (t :: Type -> Type) e n. (Foldable t, Splittable t) => (e -> Bool) -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listInsert :: (Splittable t, Applicative t, Semigroup (t e)) => Int -> e -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listInsert :: forall (t :: Type -> Type) e n. (Splittable t, Applicative t, Semigroup (t e)) => Int -> e -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listItemHeightL :: forall n_a1n8E t_a1n8F e_a1n8G. Lens' (GenericList n_a1n8E t_a1n8F e_a1n8G) Int
+ Brick.Widgets.List: listItemHeightL :: forall n (t :: Type -> Type) e f. Functor f => (Int -> f Int) -> GenericList n t e -> f (GenericList n t e)
- Brick.Widgets.List: listModify :: (Traversable t, Splittable t, Semigroup (t e)) => (e -> e) -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listModify :: forall (t :: Type -> Type) e n. (Traversable t, Splittable t, Semigroup (t e)) => (e -> e) -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveBy :: (Foldable t, Splittable t) => Int -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveBy :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => Int -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveByPages :: (Foldable t, Splittable t, Ord n, RealFrac m) => m -> EventM n (GenericList n t e) ()
+ Brick.Widgets.List: listMoveByPages :: forall (t :: Type -> Type) n m e. (Foldable t, Splittable t, Ord n, RealFrac m) => m -> EventM n (GenericList n t e) ()
- Brick.Widgets.List: listMoveDown :: (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveDown :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMovePageDown :: (Foldable t, Splittable t, Ord n) => EventM n (GenericList n t e) ()
+ Brick.Widgets.List: listMovePageDown :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t, Ord n) => EventM n (GenericList n t e) ()
- Brick.Widgets.List: listMovePageUp :: (Foldable t, Splittable t, Ord n) => EventM n (GenericList n t e) ()
+ Brick.Widgets.List: listMovePageUp :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t, Ord n) => EventM n (GenericList n t e) ()
- Brick.Widgets.List: listMoveTo :: (Foldable t, Splittable t) => Int -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveTo :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => Int -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveToBeginning :: (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveToBeginning :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveToElement :: (Eq e, Foldable t, Splittable t) => e -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveToElement :: forall e (t :: Type -> Type) n. (Eq e, Foldable t, Splittable t) => e -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveToEnd :: (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveToEnd :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listMoveUp :: (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listMoveUp :: forall (t :: Type -> Type) n e. (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listNameL :: forall n_a1n8E t_a1n8F e_a1n8G n_a1nok. Lens (GenericList n_a1n8E t_a1n8F e_a1n8G) (GenericList n_a1nok t_a1n8F e_a1n8G) n_a1n8E n_a1nok
+ Brick.Widgets.List: listNameL :: forall n1 (t :: Type -> Type) e n2 f. Functor f => (n1 -> f n2) -> GenericList n1 t e -> f (GenericList n2 t e)
- Brick.Widgets.List: listRemove :: (Splittable t, Foldable t, Semigroup (t e)) => Int -> GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listRemove :: forall (t :: Type -> Type) e n. (Splittable t, Foldable t, Semigroup (t e)) => Int -> GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listReverse :: (Reversible t, Foldable t) => GenericList n t e -> GenericList n t e
+ Brick.Widgets.List: listReverse :: forall (t :: Type -> Type) n e. (Reversible t, Foldable t) => GenericList n t e -> GenericList n t e
- Brick.Widgets.List: listSelectedElement :: (Splittable t, Traversable t, Semigroup (t e)) => GenericList n t e -> Maybe (Int, e)
+ Brick.Widgets.List: listSelectedElement :: forall (t :: Type -> Type) e n. (Splittable t, Traversable t, Semigroup (t e)) => GenericList n t e -> Maybe (Int, e)
- Brick.Widgets.List: listSelectedElementL :: (Splittable t, Traversable t, Semigroup (t e)) => Traversal' (GenericList n t e) e
+ Brick.Widgets.List: listSelectedElementL :: forall (t :: Type -> Type) e n. (Splittable t, Traversable t, Semigroup (t e)) => Traversal' (GenericList n t e) e
- Brick.Widgets.List: listSelectedL :: forall n_a1n8E t_a1n8F e_a1n8G. Lens' (GenericList n_a1n8E t_a1n8F e_a1n8G) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n (t :: Type -> Type) e f. Functor f => (Maybe Int -> f (Maybe Int)) -> GenericList n t e -> f (GenericList n t e)
- Brick.Widgets.List: renderList :: (Traversable t, Splittable t, Ord n, Show n) => (Bool -> e -> Widget n) -> Bool -> GenericList n t e -> Widget n
+ Brick.Widgets.List: renderList :: forall (t :: Type -> Type) n e. (Traversable t, Splittable t, Ord n, Show n) => (Bool -> e -> Widget n) -> Bool -> GenericList n t e -> Widget n
- Brick.Widgets.List: renderListWithIndex :: (Traversable t, Splittable t, Ord n, Show n) => (Int -> Bool -> e -> Widget n) -> Bool -> GenericList n t e -> Widget n
+ Brick.Widgets.List: renderListWithIndex :: forall (t :: Type -> Type) n e. (Traversable t, Splittable t, Ord n, Show n) => (Int -> Bool -> e -> Widget n) -> Bool -> GenericList n t e -> Widget n
Files
- CHANGELOG.md +7/−1
- README.md +7/−4
- brick.cabal +1/−1
- src/Brick/Widgets/List.hs +17/−0
- tests/List.hs +9/−0
CHANGELOG.md view
@@ -2,12 +2,18 @@ Brick changelog --------------- +2.9+---++API changes:+* Added `Brick.Widgets.List.listFindFirst` function.+ 2.8.3 ----- Bug fixes: -* Fixed a bug that completely broken `makeVisible` that was introduced+* Fixed a bug that completely broke `makeVisible` that was introduced in brick 2.6. * Fixed context cropping in `cropRightBy` and `cropBottomBy`.
README.md view
@@ -53,6 +53,7 @@ | [`2048Haskell`](https://github.com/8Gitbrix/2048Haskell) | An implementation of the 2048 game | | [`babel-cards`](https://github.com/srhoulam/babel-cards) | A TUI spaced-repetition memorization tool. Similar to Anki. | | [`bhoogle`](https://github.com/andrevdm/bhoogle) | A [Hoogle](https://www.haskell.org/hoogle/) client |+| [`bollama`](https://github.com/andrevdm/bollama) | A simple [Ollama](https://ollama.com/) TUI | | [`brewsage`](https://github.com/gerdreiss/brewsage#readme) | A TUI for Homebrew | | [`brick-trading-journal`](https://codeberg.org/amano.kenji/brick-trading-journal) | A TUI program that calculates basic statistics from trades | | [`Brickudoku`](https://github.com/Thecentury/brickudoku) | A hybrid of Tetris and Sudoku |@@ -72,6 +73,7 @@ | [`hledger-iadd`](http://github.com/rootzlevel/hledger-iadd) | An interactive terminal UI for adding hledger journal entries | | [`hledger-ui`](https://github.com/simonmichael/hledger) | A terminal UI for the hledger accounting system. | | [`homodoro`](https://github.com/c0nradLC/homodoro) | A terminal application to use the pomodoro technique and keep track of daily tasks |+| [`hskanban`](https://github.com/vincentaxhe/hskanban) | A Kanban organizer | | [`htyper`](https://github.com/Simon-Hostettler/htyper) | A typing speed test program | | [`hyahtzee2`](https://github.com/DamienCassou/hyahtzee2#readme) | Famous Yahtzee dice game | | [`kpxhs`](https://github.com/akazukin5151/kpxhs) | An interactive [Keepass](https://github.com/keepassxreboot/keepassxc/) database viewer |@@ -105,10 +107,11 @@ These third-party packages also extend `brick`: -| Project | Description |-| ------- | ----------- |-| [`brick-filetree`](https://github.com/ChrisPenner/brick-filetree) [[Hackage]](http://hackage.haskell.org/package/brick-filetree) | A widget for exploring a directory tree and selecting or flagging files and directories |-| [`brick-panes`](https://github.com/kquick/brick-panes) [[Hackage]](https://hackage.haskell.org/package/brick-panes) | A Brick overlay library providing composition and isolation of screen areas for TUI apps. |+| Project | Description | Hackage |+| ------- | ----------- | ------- |+| [`brick-filetree`](https://github.com/ChrisPenner/brick-filetree) | A widget for exploring a directory tree and selecting or flagging files and directories | [Hackage](https://hackage.haskell.org/package/brick-filetree) |+| [`brick-panes`](https://github.com/kquick/brick-panes) | A Brick overlay library providing composition and isolation of screen areas for TUI apps. | [Hackage](https://hackage.haskell.org/package/brick-panes) |+| [`brick-calendar`](https://github.com/ldgrp/brick-calendar) | A library providing a calendar widget for Brick-based applications. | [Hackage](https://hackage.haskell.org/package/brick-calendar) | Getting Started ---------------
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 2.8.3+version: 2.9 synopsis: A declarative terminal user interface library description: Write terminal user interfaces (TUIs) painlessly with 'brick'! You
src/Brick/Widgets/List.hs view
@@ -63,6 +63,9 @@ , listReverse , listModify + -- * Querying a list+ , listFindFirst+ -- * Attributes , listAttr , listSelectedAttr@@ -577,6 +580,20 @@ -> GenericList n t e -> GenericList n t e listMoveToElement e = listFindBy (== e) . set listSelectedL Nothing++-- | Find the first element in the list that satisfies the specified+-- predicate. If such an element is found, return the resulting index+-- and element.+--+-- /O(n)/.+listFindFirst :: (Semigroup (t e), Splittable t, Traversable t)+ => (e -> Bool)+ -> GenericList n t e+ -> Maybe (Int, e)+listFindFirst f l =+ listSelectedElement $+ listFindBy f $+ set listSelectedL Nothing l -- | Starting from the currently-selected position, attempt to find -- and select the next element matching the predicate. If there are no
tests/List.hs view
@@ -348,6 +348,15 @@ in l' ^. listSelectedL == Just 1 && l'' ^. listSelectedL == Just 3 +prop_listFindFirst :: Bool+prop_listFindFirst =+ let v = L [1..5] :: L Int+ l = list () v 1+ result1 = listFindFirst even l+ result2 = listFindFirst (> 10) l+ in result1 == Just (1, 2) &&+ result2 == Nothing+ prop_listSelectedElement_lazy :: Bool prop_listSelectedElement_lazy = let v = L (1:2:3:4:undefined) :: L Int