Finch
Copyright(c) Leon Vatthauer 2026
LicenseGPL-3
MaintainerLeon Vatthauer <leon.vatthauer@fau.de>
Stabilityexperimental
Portabilitynon-portable (ghc-wasm-meta)
Safe HaskellNone
LanguageGHC2024

App.Update

Description

The update loop of the application, basically all of its logic.

Synopsis

Update loop

updateModel :: Action -> Effect ROOT Model Action Source #

Main execution loop of the application.

Effects

updateProof :: Effect ROOT Model Action Source #

Re-checks a Proof, i.e. runs the verifier, updates the URI and document title.

Should be called after every change to the Proof.

updateTitle :: Effect ROOT Model Action Source #

Updates the document.title to show how many errors there are and what the conclusion of the Proof is.

checkProof :: MonadState Model m => m () Source #

Runs the Proof verification algorithm, i.e.

  1. Checks that symbols only occur with the same arity
  2. Checks freshness Assumptions
  3. Verifies all RuleApplications.

clearDrag :: Effect ROOT Model Action Source #

To be called after dragging ends, resets all drag parameters.

readURI :: URI -> Effect ROOT Model Action Source #

Takes a URI and reads in a proof if it contains one.

pushProofURI :: Effect ROOT Model Action Source #

Pushes a new URI that has the Proof encoded to the history stack.

See static/Navigation.js for the used pushStateHistory function.

replaceInitialURI :: Effect ROOT Model Action Source #

To be called in the Setup Action. Replaces the initial URI that possible does not contain the queryParameters, with a URI that does. Also initializes the tracking of the HTML5 historu API.

See static/Navigation.js for the used initHistory function.

proofReparse :: Effect ROOT Model Action Source #

Re-parses every line of the current Proof

setFocus :: Either NodeAddr NodeAddr -> Effect ROOT Model Action Source #

Set focus to a input field specified by a NodeAddr (either the Formula or the RuleApplication).

showTooltip :: MisoString -> Effect ROOT Model Action Source #

Show the popover with the given id.

hideTooltip :: Effect ROOT Model Action Source #

Hide the popover with the given id.

toggleSidebar :: Effect ROOT Model Action Source #

Flip the sidebar state and save it in sessionStorage

Parsing

class FromText a where Source #

Class for parsing Text

Methods

fromText :: Model -> Int -> Text -> Either Text a Source #

Takes a Model and some Text and tries to parse it to the desired type. On failure returns an error message.

Instances

Instances details
FromText RawAssumption Source # 
Instance details

Defined in App.Update

FromText RawFormula Source # 
Instance details

Defined in App.Update

FromText RuleApplication Source # 
Instance details

Defined in App.Update

tryParse Source #

Arguments

:: FromText a 
=> Model

The Model.

-> Int

Line number.

-> Text

Text to parse.

-> Wrapper a

Parse result.

Wrapper for fromText that also takes a list of aliases and tries to replace these aliases in the Text

reparse Source #

Arguments

:: FromText a 
=> Model

The Model.

-> Int

The line number.

-> Wrapper a

The Wrapper to re-parse.

-> Wrapper a

Parse result.

Takes some Wrapper and re-parses it.

reparseProof :: Model -> Proof -> Proof Source #

Uses reparse to re-parse the whole Proof.