h&+      !"#$%&'()*  Safe-Inferred !$&():XpurviewThis is for creating events that should go to a parent handler, or sent back in to the same handler.+purviewThese encapsulate events that come from the front end in addition to events that are internal. For example, state changes or messages being sent to handlers higher up in the tree.,purview*This for events intended for the front end +-./01,234 Safe-Inferred!$() purviewThis is what you end up building using the various helpers. It's hopefully rare that you have to use these directly, but it may be useful to better understand what's happening behind the scenes.purview'All the handlers boil down to this one. purview"Attributes are collected until an HTML= constructor is hit, where they are applied during rendering.purviewThis is most straightforward effect handler. It can't send messages to itself or to its parent.For example, let's say you want to make a button that switches between saying "up" or "down": view direction = onClick "toggle" $ button [ text direction ] handler = simpleHandler "up" reduce where reduce "toggle" state = if state == "up" then "down" else "up" component = handler viewpurviewMore powerful than the , it can send messages to itself or its parent. You will also note that instead of just returning the new state, it returns a function to transform the state. This is because handlers run in their own threads.purviewThis handler gives you access to whichever monad you're running Purview with.If you wanted to print something on the server every time someone clicked a button: view direction = onClick "sayHello" $ button [ text "Say hello on the server" ] handler = effectHandler Nothing reduce where reduce "sayHello" state = do print "someone on the browser says hello!" pure (const Nothing, []) component = handler view5purviewThis is for kicking off loading events. Put it beneath one of your handlers to send an event up to it, and it will only be sent once.purviewFor adding styles blue = style "color: \"blue\";" blueButton = blue $ button [ text "I'm blue" ]purviewThis will send the action to the handler above it whenever "click" is triggered on the frontend. It will be bound to whichever HTML is beneath it.purviewThis will send the action to the handler above it whenever "submit" is triggered on the frontend.purviewThe location of the parent effect handler (provided by prepareTree)purview=The location of this effect handler (provided by prepareTree)purviewThe initial statepurview6Receive an action, change the state, and send messagespurview Continuation purview?part of creating handlers for different events, e.g. On "click" purview inline csspurviewfor creating new Attributes to put on HTML, e.g. Generic "type" "radio" for type="radio".purviewThe initial statepurview9The reducer, or how the state should change for an actionpurview*The continuation / component to connect topurview initial statepurviewreducerpurview continuationpurview initial statepurviewreducer (note the m!)purview continuation" 67 589 Safe-Inferred!$&c:purview?@A Safe-InferredBCDEFGHI Safe-Inferred!$JpurviewThis walks through the tree and collects actions that should be run only once, and sets their run value to True. It's up to something else to actually send the actions.:It also assigns a location to message and effect handlers.KJL Safe-Inferred purviewTakes the tree and turns it into HTML. Attributes are passed down to children until they reach a real HTML tag.MNOPQ R  Safe-Inferred!$&S  Safe-Inferred!TUVWXYZ[\]^_`ab Safe-Inferred!$&m#purview+The top level component to put on the page.$purviewHow to run your algebraic effects or other. This will apply to all s.%purviewSpecify what to do with logs&purview2For extending the handled events. Have a look at ) to see how to make your own.'purviewThis is placed directly into the , so that you can link to external CSS etc(purviewWhen enabled, Purview will send the whole tree on websocket reconnection. This enables you to use "ghcid --command 'stack ghci examples/Main.hs' --test :main`" to restart the server on file change, and get a kind of live reloading*purviewThis starts up the Scotty server. As a tiny example, to display some text saying "hello": import Purview view = p [ text "hello" ] main = run defaultConfiguration { component=view }+   !"$#(&'%)*+*!"$#(&'%)       !"#$%&'()*++,-./01234567894:;5<=>?@ABCDEFGHIJKLMNOPQGRSTUVWX Y Z [ \ ] Z ^ _ ` a b c d e f gpurview-0.1.0.0-inplacePurviewEvents Component EventHandlingDiffing Paths_purview PrepareTree Rendering EventLoopWrapper DirectedEventParentSelf AttributeTextHtmlValue EffectHandlerOnceHide AttributesOnStyleGeneric simpleHandlermessageHandler effectHandlerdivspanh1h2h3h4pbuttonforminputtextstyleonClickonSubmitrender Configuration$sel:component:Configuration$sel:interpreter:Configuration$sel:logger:Configuration$$sel:htmlEventHandlers:Configuration$sel:htmlHead:Configuration$sel:devMode:ConfigurationdefaultConfigurationrunEventForFrontEndEvent$sel:event:Event$sel:location:Event$sel:message:EventStateChangeEvent$sel:event:ForFrontEndEvent$sel:message:ForFrontEndEventonceParentIdentifier Identifier identifierclasses applyNewStaterunEventChangeAddDeleteUpdateLocationdiffversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir prepareTree prepareTree'isOn isGenericgetStyle renderGenericrenderAttributesrender' eventLoopHtmlEventHandlerhandlingFunction eventType functionNameclickEventHandlingFunctionclickEventHandlersubmitEventHandlingFunctionsubmitEventHandlerdefaultHtmlEventHandlers mkBinding mkFunction bindEventswebsocketScriptwrapHtml