?      !"#$%&'()*+,-./0123456789:;<=> experimentalgershomb@gmail.comNone(This class should not be used directly. (This class should not be used directly. A JsonRPC is a named function that takes a handle to some state, and yields a function from request to result in some monad. It is a representation of the server side of an RPC call. -A JSON result is either an error or a value. #A JSON request is a list of values retErr = return . Left *Takes a compatible function to a JsonRPC. TTakes a compatible function to a JsonRPC making use of state (i.e. a conversation). Send a function on Jsonable values to a function of the same signature whose logic is invokable on a remote server. This function operates on the type of its argument. The body can remain undefined. ^Takes a name and a function and yields both the server-side JsonRPC and the client-side stub. CJMacro Javascript stub to invoke json-rpc calls from web browsers. id with a helpful type. Given a function for managing local state, and a list of JsonRPCs over that local state, produce a function from Bytestring to Bytestring mapping json-rpc requests to responses. XUsed for creating server backends. Yes, this type is confusing. But unless you are creating a server backend, you can ignore it. Takes a function to generate some time identifier, a function to cull page state, a rpc handler, a function for creating a single page, a function to initialize a page state, and a bunch of rpcs, and creates a pair of handler functions (one for POST and one for GET) such that individual clients first pull a page with an embedded ID, along with client-side rpc functions. Those functions in turn interact with state local to that invocation of a page when they make json-rpc requests to the server. The cull function is in IO so it has access to whatever notion of time it desires, including the opportunity to not run at all. Note that the POST page should be served from the same url as the get page, but with an additional /jrpcs directory guard. MConverts a json rpc to a javascript declaration of the appropriate function.  ?@AB      ?@AB experimental gershomb@gmail.com None%<A Panel is the pair of an action to produce a PageSlice and C an action to produce a list of locations with updated PageSlices. @ The former is used to draw the initial page, and the latter to F modify it in response to events. Panels are also naturally Monoidal. HA PageSlice is a pair of Html and JavaScript. When a Panel is rendered,  all JavaScript ends up joined together in the head of the page, and all HTML below it. PageSlices are naturally Monoidal, just as Html is. ?The PState Monad Transformer provides access o the PanelState. EA PanelState contains environment information used to render Panels. Sinks likewise are tagged as JS, Hask, or parametric. A sink of type JS can be written to purely on the client side, with no round trip. A sink of type Hask is a contravariant functor. <A Signal can contain information drawn from client-side inputs. Signals are tagged as JS, Hask, or parametric. A signal of type JS can be read from purely on the client side, with no round trip. A signal of type Hask forms an applicative functor, so we can build server-side values with complex computed behaviours.  Note that  Signal Hask5 actually bends the applicative functor laws in that fmap id on a signal that can be calculated directly in JS can send it to a signal that cannot be. This is a flaw, and it will be fixed. @Conceptually, an Event is something that can trigger an update. ( We can join two events (which gives us or semantics), and we can  trigger on an event. That's it. 9 In reality, an event is composed of the panelpaths to it' s sources. !9Unique label for any given panel in a control structure. "EType tag for Sinks and Signals that require server-side interaction. #CType tag for Sinks and Signals that can be run in pure JavaScript. $ESince only some Signals are applicative functors, pureSig provides a pure operation over all Signals. %BA JavaScript funcion can be contravariantly mapped over a Sink JS &%We can zip sinks up to combine them. '4We can get a fresh identifier out of a panel state. (:And we can get an identifier out before descending into a local " environment whose identifiers don'#t affect the main supply. Hence if D a local environment alters its pattern of consumption, identifiers . in the outer environment will remain stable. )-We can lift any Html into a Panel trivially. *Similarly, we can map over any Html inside a panel (although the behavior may be odd on panels with internal update semantics). +tGiven a function to join Html sections, we can fuse a list of panels into a single pannel by lifting that function. ,|Given an arbitrary Signal, and a continuation accepting a value of the underlying type of the signal, yield a simple Panel. -YGiven a Signal JS, produce a JavaScript expression that samples the value of the signal. .IGiven an Event, and a Panel, update the Panel each time the event fires. /Feed a value to a Sink. 0Given an event, a signal, and a sink, on each firing of the event, feed the sink the current sampled value of the signal. If the Signal and Sink are both in JS, this can happen entirely on the client side. 1This is a general purpose function for constructing Panels that provide signals and events, and optionally sinks. It takes a function from an identifier path to an intial value of a signal, optional sinks into the signal, and a panel  controlling the signal. From this it yields a continuation function from the event and signal associated wih the panel, the optional sinks, and the signal control/ panel to a new panel to the new panel iself. [ Usage of this function is best understood by viewing the source of inputs built using it. 2aTakes an initial value and a continuation taking an event and the button itself, yields a panel. 3Takes an intial (label, value) pair, a list of pairs of labeled values, and a continuation, building a Panel with a dropdown selector. 4WPerform an action in the underlying monad and feed the result to a panel. Synchronous. T Note that this action will occur on every update, even when guarded by an onEvent. 5_Execute an IO action when triggered by an event. This action only occurs when the event fires.  QbindEventIO e act = onEvent e $ Panel (return mempty) (lift act >> return mempty) 6Ja wrapper around select that immediately samples from the yielded signal. 1selectInput defOpt opts k = select defOpt opts $ e sig p -> withSample sig $ i -> k e i p 7KA basic text input box. This box provides a Sink as well as a Signal, so it':s contents can be controlled from elsewhere in the Panel. 8TA hidden input Panel that can be used as a mutable store, akin to an IORef or MVar. 91Put a bunch of panels into a single div element.  inDiv = onHtml H.div . mconcat :!Put some text into a p element.  $para = plainHTML . H.p . fromString ;FAlign a list of panels into a table with rows of the specified width.  BmkTable n xs = onHtml H.table . mconcat . map row $ chunksOf n xs @ where row ys = onHtml H.tr . mconcat $ map (onHtml H.td) ys <1JavaScript code for the reactive runtime system. =OGeneral function used to create backends for different servers and frameworks. >*Example panel that displays a calculator. KCDEFGHIJKLMN O!"#P$QR%&STUV'(WXY)Z*[+,\-./01Ygiven a path, construct a so-located panel with an intial value and possibly some Sinks. Pgiven a so-constructed panel, event, and signal, declare what panel to produce.  result panel 23456789:;<=,A function which serves stateless JsonRPCs. 4A function which renders Text to a server response. A page title. The panel to server nTwo page handlers -- one for handling updates (POSTs), and the second for rendering the initial page (GETs). >]^_`ab+ !"#$%&'()*+,-./0123456789:;<=>+#"! '($&%)*+19:;,-./04523678<=>9CDEFGHIKJNML O!"#P$QR%&STUV'(WXY)Z*[+,\-./0123456789:;<=>]^_`abc       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN!OPQRSTUVWXYZ[\]^_`abjmacro-rpc-0.2Network.JMacroRPC.BaseNetwork.JMacroRPC.Panels JStateAsyncJState ToJsonRPCCalltoJsonRPCCall_ ToJsonRPC toJsonRPC_JsonRPCJResultJRequestretErr toJsonRPC toJsonConvRPC toJsonRPCCall mkJsonRPCPair invokeRPCLibasIO handleRpcsmkConversationPageGen jsonRPCToDeclPaneldrawPupdateP PageSlicePShtmlPjsPPState PanelStateSinkSignalEvent PanelPathHaskJSpureSig contramapJszipSinksnewIdent descended plainHTMLonHtmljoinWith withSample sampleSigJsonEventtellSink bindSigSink buildInputbuttonselectsampleIO bindEventIO selectInputtextPanenewVarinDivparamkTable panelPreludepanelToPageGen calcPanel$fToJsonRPCCall(->)(->)$fToJsonRPCCallIO(->)$fToJsonRPC(->)m$fToJsonRPCIOIO UpdateListps_pathps_env ps_env_clean ps_events ps_listenerPureSink ServerSinkMultiSigOneSigPureSig printPathliftSinkrunSink extractIds readSignalsetEnvincrPath runPanelDrawrunPanelUpdateSlicerunPanelUpdateManyonHtmlPS joinWithPSsetDependenciesSig $fMonoidPanel$fMonoidPageSlice$fContravariantSink$fApplicativeSignal$fFunctorSignal $fMonoidEvent