module Main where
-- SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
-- For more information, please refer to <https://unlicense.org/>
-- SPDX-License-Identifier: Unlicense
import Haste.DOM (withElems, getValue, setProp)
import Haste.Events (onEvent, MouseEvent(Click))
import PLexceptGOTOdotNET (run)
main = withElems ["prog", "result", "run-button"] driver
driver [progElem, resultElem, runButtonElem] =
onEvent runButtonElem Click $ \_ -> do
Just prog <- getValue progElem
setProp resultElem "textContent" $ run prog