vgrep-0.2.3.0: A pager for grep
Safe HaskellNone
LanguageHaskell2010

Vgrep.Widget.Type

Synopsis

Documentation

data Widget s Source #

A Widget is a unit that is displayed on the screen. It is associated with a mutable state s. It provides an event handler with default keybindings and can generate a renderable Image.

Widget modules should provide a Widget instance and additionally a collection of actions that can be invoked by external event handlers:

widgetAction :: VgrepT s m Redraw

Constructors

Widget 

Fields

  • initialize :: s

    The initial state of the widget

  • draw :: forall m. Monad m => VgrepT s m Image

    Generate a renderable Image from the widget state. The state can be modified (e. g. for resizing).

Re-exports from Vgrep.Event

data Redraw Source #

Constructors

Redraw

Indicates that the state has been changed visibly, so the screen should be refreshed.

Unchanged

The state has not changed or the change would not be visible, so refreshing the screen is not required.

Instances

Instances details
Semigroup Redraw Source # 
Instance details

Defined in Vgrep.Event

Monoid Redraw Source # 
Instance details

Defined in Vgrep.Event

data Next a Source #

The type of action to be performed on an event.

Constructors

Skip

Do not handle the event (fall-through to other event handlers)

Continue a

Handle the event by performing an action

Interrupt Interrupt

Interrupt the application

Instances

Instances details
Functor Next Source # 
Instance details

Defined in Vgrep.Event

Methods

fmap :: (a -> b) -> Next a -> Next b #

(<$) :: a -> Next b -> Next a #

Semigroup (Next a) Source #

The first event handler that triggers (i. e. does not return Skip) handles the event.

Instance details

Defined in Vgrep.Event

Methods

(<>) :: Next a -> Next a -> Next a #

sconcat :: NonEmpty (Next a) -> Next a #

stimes :: Integral b => b -> Next a -> Next a #

Monoid (Next a) Source # 
Instance details

Defined in Vgrep.Event

Methods

mempty :: Next a #

mappend :: Next a -> Next a -> Next a #

mconcat :: [Next a] -> Next a #