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

App.Entry

Description

This is the entry point of the Finch application. It reads the ?logic= and ?proof= URL query parameters to select the initial logic (propositional or first-order) and to optionally restore a Proof encoded in the URL, then starts the Miso application with the appropriate Model.

Synopsis

Running the App

startAppWrapper :: DOMRef -> Model -> IO () Source #

Starts the Miso application for the given window DOMRef and initial Model.

Registers the browser event listeners (drag, keyboard, mouse, touch and default events), mounts the application with the Setup action, and adds the PopState URI subscription together with the keyboard subscription onKeyDownSub.

runApp :: IO () Source #

Application entry point.

  1. Reads the current URI.
  2. Inspects the ?logic= query parameter:
  • prop — initializes propositional logic via initialModelProp.
  • fol — initializes first-order logic via initialModelFOL.
  • defaults to fol. 3. If a ?proof= query parameter is present, decodes it with decodeFromUrl and uses it as the initial Proof; otherwise the default example proof for the selected logic is shown. 4. Then starts the Miso application using startAppWrapper.

Subscriptions

onKeyDownSub :: DOMRef -> Sub Action Source #

Subscription for the onkeydown event.

Used for detecting presses of ( and Enter.

  • On Enter fires the Blur event,
  • On ( inserts the closing parenthesis at the end of selection.

resizeSub :: DOMRef -> Sub Action Source #

Subscription for the resize event https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/resize_event

Dynamically adjusts the _onMobile field of the Model