Copyright | (C) 2019 QBayLogic |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Orestis Melkonian <melkon.or@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Basic datatypes.
Synopsis
- type Binder = String
- data NoCustomEvent
- data Name
- type Cursor = CursorLocation Name
- data Command
- data OptionsUI term = OptionsUI {}
- opts :: forall term term. Lens (OptionsUI term) (OptionsUI term) (Options term) (Options term)
- com :: forall term. Lens' (OptionsUI term) Command
- data VizState term = VizState {}
- steps :: forall term. Lens' (VizState term) (History term (Ctx term))
- rightN :: forall term. Lens' (VizState term) Int
- prevState :: forall term. Lens' (VizState term) (Maybe (VizState term))
- leftN :: forall term. Lens' (VizState term) Int
- curStep :: forall term. Lens' (VizState term) Int
- curOccur :: forall term. Lens' (VizState term) Int
- curExpr :: forall term. Lens' (VizState term) term
- data VizStates term = VizStates {}
- width :: forall term. Lens' (VizStates term) Int
- states :: forall term. Lens' (VizStates term) (Map Binder (VizState term))
- showBot :: forall term. Lens' (VizStates term) Bool
- scroll :: forall term. Lens' (VizStates term) Bool
- height :: forall term. Lens' (VizStates term) Int
- form :: forall term. Lens' (VizStates term) (Form (OptionsUI term) NoCustomEvent Name)
- curBinder :: forall term. Lens' (VizStates term) Binder
- binders :: forall term. Lens' (VizStates term) [Binder]
- mkForm :: forall term. Diff term => OptionsUI term -> Form (OptionsUI term) NoCustomEvent Name
- createVizStates :: forall term. Diff term => History term (Ctx term) -> VizStates term
- initialState :: Diff term => History term (Ctx term) -> VizState term
- currentStepName :: VizState term -> String
- getStep :: VizStates term -> Binder -> (Int, Int, String)
- getCurrentState :: VizStates term -> VizState term
- getSearchString :: Diff term => VizStates term -> String
- formData :: forall term. Diff term => Lens' (VizStates term) (OptionsUI term)
- updateState :: VizStates term -> VizState term -> VizStates term
- getCodeWidth :: VizStates term -> Int
- stepBinder :: VizStates term -> VizStates term
- unstepBinder :: VizStates term -> VizStates term
- step :: Diff term => VizState term -> VizState term
- unstep :: Diff term => VizState term -> VizState term
- reset :: Diff term => VizState term -> VizState term
- data Direction
- moveTo :: Diff term => Int -> VizState term -> VizState term
- nextTrans :: Diff term => Direction -> String -> VizState term -> VizState term
- nextOccur :: Diff term => Direction -> VizState term -> VizState term
Basic types.
Program binders (i.e. top-level identifiers) are identified by their name.
data NoCustomEvent Source #
Our Brick
TUI does not use any custom events.
The type of resource names, used throughout the TUI.
LeftViewport | |
RightViewport | viewports |
FormField String | form fields |
SearchResult Int | search results with numbered occurrences |
Other |
Commands that the user can issue through the input form.
Step Int | move to given step in the current binder |
Trans String | move to the next/previous transformation with the given name |
Search String | move to the next/previous occurrence of the searched string |
Options kept and changed throught the TUI's input form.
opts :: forall term term. Lens (OptionsUI term) (OptionsUI term) (Options term) (Options term) Source #
Bottom-level state of the UI (navigate steps of a top-level binder).
VizState | |
|
Top-level state of the UI (navigate top-level binders).
VizStates | |
|
Getters and setters.
mkForm :: forall term. Diff term => OptionsUI term -> Form (OptionsUI term) NoCustomEvent Name Source #
Create the input form.
createVizStates :: forall term. Diff term => History term (Ctx term) -> VizStates term Source #
Group the rewrite history by the different top-level binders.
initialState :: Diff term => History term (Ctx term) -> VizState term Source #
State initialization for the bottom layer.
currentStepName :: VizState term -> String Source #
Get the name of the current transformation.
getStep :: VizStates term -> Binder -> (Int, Int, String) Source #
Get information about the current step.
getCurrentState :: VizStates term -> VizState term Source #
Get the current state of the bottom layer.
getSearchString :: Diff term => VizStates term -> String Source #
Get the current string we are searching for. NB: Returns the empty string of no search command has been issued.
formData :: forall term. Diff term => Lens' (VizStates term) (OptionsUI term) Source #
Lens from the global state to the input form's data.
updateState :: VizStates term -> VizState term -> VizStates term Source #
Update the local state of the current binder.
getCodeWidth :: VizStates term -> Int Source #
Get the available code width for one of the two code panes.
stepBinder :: VizStates term -> VizStates term Source #
Cycle through top-level binders in the global state.
stepBinder
- Proceed forward.
unstepBinder
- Proceed backward.
unstepBinder :: VizStates term -> VizStates term Source #
Cycle through top-level binders in the global state.
stepBinder
- Proceed forward.
unstepBinder
- Proceed backward.
step :: Diff term => VizState term -> VizState term Source #
Cycle through transformations of the current binder in the local state.
step
- Proceed forward.
unstep
- Proceed backward.
reset
- Reset to the initial state.
unstep :: Diff term => VizState term -> VizState term Source #
Cycle through transformations of the current binder in the local state.
step
- Proceed forward.
unstep
- Proceed backward.
reset
- Reset to the initial state.
reset :: Diff term => VizState term -> VizState term Source #
Cycle through transformations of the current binder in the local state.
step
- Proceed forward.
unstep
- Proceed backward.
reset
- Reset to the initial state.
User-issued commands.
Some user commands have a notion of direction; either going forth or back.
moveTo :: Diff term => Int -> VizState term -> VizState term Source #
Move to a specified step of the transformations of the current binder.