,      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                     ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }~(c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental  Safe-Inferred24 jRGB can be used to specify colors more precisely. Create them with one of the two smart constructors  or . We provide a data type for colors to allow users to easily and clearly specify common colors. Primary and secondary RGB colors are represented along with a few beige colors for use in many GUI elements. 8This is the default background color for the UI window. cGenerally used as an internal function for converting Color to RGB, but can be used by anyone. This function takes three integral values between 0 and 255 inclusive and create an RGB value with them. If any of the values fall outside the acceptable range, Nothing is returned. This is a version of  that throws an error when a given value falls outside the acceptable 0-255 range. The error message shows the bad input, so the extra Show constraint is necessary. 2Use this to extract the values from an RGB color.      (c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental  Safe-Inferred24 rAngles are used when making arcs, circles, etc. or when performing rotations. Angles are measured in Degrees !>A rectangle has a (bottom left) corner point and a dimension. "A dimension specifies size. #$Point describes a point on the GUI.  !"# !"## "! !"#(c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental None24 $PThe Wrap Setting is used to determine how to split up a long piece of text. (To retain easy compatibility with Strings (or other text representations), we also provide the UITexty class, which is how all widgets that accept UIText should do so. *Text in UISF can be rendered in multiple fonts and colors, so we need a more powerful data type to encode it. The UIText data type does this. The empty string in UIText. =Returns True when given an empty string and False otherwise. -iRemoves all font and color formatting from a UIText, returning its underlying String representation. ..Returns the number of characters in a UIText. /4Take a certain number of characters off of a UIText 02Drop a certain number of characters from a UIText 1-Split a UIText at the given character point. jA convenience function for taking a UITexty object directly to the underlying (RGB,Font,String) list. 2:Lifts a String to a UIText (with default color and font). 3&Appends two UITexty objects together. 4Colors a UITexty object. 51Colors a UITexty object with an exact RGB value. 6/Converts the UITexty object to the given font. 7AReturns the width of the String in pixels as it will be rendered 8Given a String and a number of pixels, returns the leading substring that fits within the horizontal number of pixels along with the remaining text of the String. 9BReturns the height of the String in pixels as it will be rendered :Turn the given String into a list of Strings. If the wrap setting is NoWrap, then this is basically just the lines function. If it is CharWrap or WordWrap, then no string in the list will be wider than the width of the bounding box. The returned list of points indicate each Point where a line should be drawn. Note that this list may not be the same length as the list of strings. aTypically, this will be used in conjunction with zip and textLines to produce text graphics. wrapText takes a wrap setting, a width, and a string, and turns it into a list of strings representing each wrapped line. Strings are assumed to have no line breaks in them. Calling unlines on the output will create a String that is wrapped. ;The common String  function applicable to UIText. <The common String  function applicable to UIText. ZA variant of uitextLines that keeps the newline characters at the ends of the output. ]A variant of uitextWords that keeps the whitespace characters at the ends of the output. CA convenience function for writing functions like lines and words. =GReturns the text height of a String rendered in the given bitmap font. >FReturns the text width of a String rendered in the given bitmap font. ?Splits a String based on what can fit within the given number of pixels (the fst of the result) and what's left over (the snd). *Returns the font height for a given font. )Returns the font array for a given font. #Makes Char width arrays for fonts. 5$%&'()*+,-./0123456789:&Whether we prefer newer or older text  Line spacing  Bounding Box 7The text to print (which is allowed to have new lines) ;<=>?$$%&'()*+,-./0123456789:;<=>?$*+,()-1/0.23456789$'&%:>?=<;/$'&%()*+,-./0123456789:;<=>?(c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental None@The main Graphic data type stores graphic information. Constructors are not directly exposed to encourage the use of the smart constructors. If you would like to add custom rendering functions for Graphic, you will clearly need access to the constructors to destruct the graphics. Please request this, and I can either export them or we can discuss adding more rendering functions to this library. NThe absence of a graphic. O8The overlay of two graphics, the first over the second. P)Paint the given text at the given point. QCA convenience function for painting a set of (Point,String) pairs. R0Use the given color to paint the given graphic. S4Use the given RGB color to paint the given graphic. T0Draw an ellipse bounded by the given rectangle. UhDraw a shear ellipse bounded by the given rectangle. This code was written originally by Paul Liu. V5Draw a line segment connecting the given two points. W@Draw a filled polygon with corners defined by the given points. X>Draw a sequence of line segments defined by the given points. Y1Draw a Bezier curve defined by the given points. Z}Draw an arc of the ellipse bounded by the given rectangle that starts at the first angle measure and ends at the second. [3Draw a filled circle with given center and radius. \;Draw the outline of a circle with given center and radius. ]Draw a filled rectangle. ^!Draw the outline of a rectangle. _JTranslate the given graphic so that its origin is at the given point. `TRotate the given graphic around the given point by the given number of degrees. a?Scale the given graphic in the X and Y dimension respectively. bUCut the given graphic so that nothing outside of the given rectangle is visible. &@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab#@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab#@MLKJIHGFEDCBANORSPQTUVWXYZ[\]^_`ab@ MLKJIHGFEDCBANOPQRSTUVWXYZ[\]^_`ab(c) Daniel Winograd-Cort 2014 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental  Safe-Inferred3E&c\The BufferOperation data type wraps up the data and operational commands to control an  eventbuffer. dSet the buffer's tempo e7Set a new play status (True = Playing, False = Paused) f%Append data to the end of the buffer gMerge data into the buffer h2Skip ahead a certain amount of time in the buffer iErase the buffer jNo Buffer Operation kTempo is just a Double. l8DeltaT is a type synonym referring to a change in Time. m(Time is simply represented as a Double. nDSEvent is short for "Stream Event" and is a type synonym for Maybe. o:This is a convenience function for any DeltaT ArrowReader pqThis function returns the accumulated delta times created by getDeltaT. Thus, it is the "accumulated" time. q)constA is an arrowized version of const. r#constSF is a convenience composing q with the given SF. sedge generates an event whenever the Boolean input signal changes from False to True -- in signal processing this is called an ``edge detector,'' and thus the name chosen here. tThe signal function (accum v) starts with the value v, but then applies the function attached to the first event to that value to get the next value, and so on. uZThe signal function unique will produce an event each time its input signal changes. vhold is a signal function whose output starts as the value of the static argument. This value is held until the first input event happens, at which point it changes to the value attached to that event, which it then holds until the next event, and so on. wNow is a signal function that produces one event and then forever after produces nothing. It is essentially an impulse function. x=mergeE merges two events with the given resolution function. y#This is an infix specialization of x to lists. Returns n samples of type b from the input stream at a time, updating after k samples. This function is good for chunking data and is a critical component to fftA zqCombines the input list of arrows into one arrow that takes a list of inputs and returns a list of outputs. {This essentially allows an arrow that processes b to c to take [b] and recursively generate cs, combining them all into a final output d. |+This is a special case of foldA for lists. }3For folding results of a list of signal functions. ~This behaves much like the maybe function except lifted to the ArrowChoice level. The arrow behaves like its first argument when the input stream is Nothing and like its second when it is a Just value. wThis lifts the arrow to an event-based arrow that behaves as a constant stream of Nothing when there is no event. fdelay is a delay function that delays for a fixed amount of time, given as the static argument. It returns a signal function that takes the current time and an event stream and delays the event stream by the delay amount. fdelay guarantees that the order of events in is the same as the order of events out and that no event will be skipped. However, if events are too densely packed in the signal (compared to the clock rate of the underlying arrow), then some events may be over delayed. vdelay is a delay function that delays for a variable amount of time. It takes the current time, an amount of time to delay, and an event stream and delays the event stream by the delay amount. vdelay, like fdelay, guarantees that the order of events in is the same as the order of events out and that no event will be skipped. If the events are too dense or the delay argument drops too quickly, some events may be over delayed. Tfcdelay is a continuous version of fdelay. It takes an initial value to emit for the first dt seconds. After that, the delay will always be accurate, but some data may be ommitted entirely. As such, it is not advisable to use fcdelay for event streams where every event must be processed (that's what fdelay is for). yvcdelay is a continuous version of vdelay. It will always emit the value that was produced dt seconds earlier (erring on the side of an older value if necessary). Be warned that this version of delay can both omit some data entirely and emit the same data multiple times. As such, it is usually inappropriate for events (use vdelay). vcdelay takes a maxDTl argument that stands for the maximum delay time that it can handle. This is to prevent a space leak. Implementation note: Rather than keep a single buffer, we keep two sequences that act to produce a sort of lens for a buffer. qlow has all the values that are older than what we currently need, and qhigh has all of the newer ones. Obviously, as time moves forward and the delay amount variably changes, values are moved back and forth between these two sequences as necessary. This should provide a slight performance boost. timer is a variable duration timer. This timer takes the current time as well as the (variable) time between events and returns an SEvent steam. When the second argument is non-positive, the output will be a steady stream of events. As long as the clock speed is fast enough compared to the timer frequency, this should give accurate and predictable output and stay synchronized with any other timer and with time itself. genEvents is a timer that instead of returning unit events returns the next element of the input list. When the input list is empty, the output stream becomes all Nothing. eventBuffer allows for a timed series of events to be prepared and emitted. The streaming input is a BufferOperation, described above. Note that the default play status is playing and the default tempo is 1. Just as MIDI files have events timed based on ticks since the last event, the events here are timed based on seconds since the last event. If an event is to occur 0.0 seconds after the last event, then it is assumed to be played at the same time as the last event, and all simultaneous events are emitted at the same timestep. In addition to any events emitted, a streaming Bool is emitted that is True if the buffer is empty and False if the buffer is full (meaning that events will still come). VeventBuffer' is a version that takes Time explicitly rather than with ArrowTime. +cdefghijklmnopqrstuvwxyz{|}~' cdefghijklmnopqrstuvwxyz{|}~'nmlopqrstuvwxyz|{}~ kcjihgfed$cjihgfedklmnopqrstuvwxyz{|}~(c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental  Safe-Inferred3EIO automatons from b to c are functions that take a b value and perform an IO action that returns a c value along with a new IO automaton from b to c. Pure automatons from b to c are functions that take a b value and return a c value along with a new pure automaton from b to c. UInstances of the ArrowIO class have an arrowized ability to perform IO actions. 7The liftAIO function lifts an IO action into an arrow. The initialAIO function performs an IO action once when the arrow is first initialized and then uses the result of that action to generate the arrow itself. The terminalAIO function stores an IO action to be performed once when the arrow terminates. This will typically be some sort of clean up behavior. @A convenience function for converting stateful functions to  s. 4A convenience function for converting IO actions to s. AA convenience function for converting stateful IO actions to s. %A convenience function for lifting a  into an . The asyncV functions is for "Virtual time" asynchrony. The embedded signal function is given along with an expected clockrate, and the output conforms to that clockrate as well as it can. The clockrate is the simulated rate of the input signal function. The buffer is the amount of time the given signal function is allowed to get ahead of real time. The output signal function takes and returns values in real time. The input must be paired with time, and the return values are the list of bs generated in the given time step, each time stamped. Note that the returned list may be long if the clockrate is much faster than real time and potentially empty if it's slower. Note also that the caller can check the time stamp on the element at the end of the list to see if the inner, "simulated" signal function is performing as fast as it should.  A variant of  that uses 5 internally and thus takes a core ID to fork on.  A variant of Y that uses a built-in time step of the arrow to accumulate and use the current time.  A variant of  that uses 5 internally and thus takes a core ID to fork on. The asyncE (E for "Event") function takes a signal function (an Automaton) and converts it into an asynchronous event-based signal function usable in a ArrowIO signal function context. The output arrow takes events of type a, feeds them to the asynchronously running input signal function, and returns events with the output b whenever they are ready. The input signal function is expected to run slowly compared to the output one, but it is capable of running just as fast.  A variant of  that uses 5 internally and thus takes a core ID to fork on.  A variant of  that takes an  and can thus perform  actions.  A variant of  that uses 5 internally and thus takes a core ID to fork on. The asyncC (C for "Continuous time") function allows a continuous signal function to run as fast as it can asynchronously. There are no guarantees that all input data make it to the asynchronous signal function; if this is required, asyncE should be used instead. Rather, the embedded signal function runs as fast as it can on whatever value it has most recently seen. Its results are bundled together in a list to be returned to the main signal function.  A variant of  that uses 5 internally and thus takes a core ID to fork on.  A variant of  that takes an  and can thus perform  actions.  A variant of  that uses 5 internally and thus takes a core ID to fork on.  Clockrate Amount of time to buffer The automaton to run virtually Core to fork on  Clockrate Amount of time to buffer The automaton to run virtually fork  Clockrate Amount of time to buffer %The automaton to convert to realtime  Clockrate Amount of time to buffer The automaton to run virtually Core to fork on  Clockrate Amount of time to buffer The automaton to run virtually )The automaton to convert to asynchronize Core to fork on The automaton to asynchronize fork The automaton to asynchronize *Initialization and termination procedures The automaton to asynchronize Core to fork on *Initialization and termination procedures The automaton to asynchronize fork *Initialization and termination procedures The automaton to asynchronize %The automaton to convert to realtime Core to fork on %The automaton to convert to realtime fork %The automaton to convert to realtime *Initialization and termination procedures %The automaton to convert to realtime Core to fork on *Initialization and termination procedures %The automaton to convert to realtime fork *Initialization and termination procedures %The automaton to convert to realtime   (c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental None24O  !"#$%&'()*+,-./0123456789:=>?@NOPQRSTUVWXYZ[\]^_`abO# "! @NORSPQTUVWXYZ[\]^_`ab*+,()-1/0.23456789$'&%:>?=(c) Daniel Winograd-Cort 2014 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental NoneC(]The standard mouse buttons are represented, but for specialty mice, one can also use the  value. IA special key is any non-standard character key. According to GLUT, h should never be used, probably because it will be treated as a weird Char instead of a SpecialKey. CA Key can either be a character, a special key, or a mouse button. The UIEvent data type captures the various types of events that the UI can produce. These are covered by regular keys, special keys, mouse button presses, and mouse movement. Any key event is accompanied by a list of 6s that were down when the given event took place. The NoUIEvent fires when nothing else is going on. It is important that this happens to allow interaction-independent processing to continue (e.g. timers, animations, etc.). ;Every time the mouse moves, a MouseMove UIEvent will fire. IA Button UIEvent indicates that the user has pressed a mouse button. |A SKey UIEvent indicates that the user has typed a special key. These are Enter, Backspace, Tab, Delete, etc. See  for more. A Key UIEvent indicates that the user has typed a regular key on his/her keyboard. These will either be upper or lowercase characters. *The FocusInfo means one of the following: zAny widget that sees this value should recognize that they are no longer in focus. This is useful for nested focus. rIndicates that the widget whose id is given should take focus. That widget should then pass NoFocus onward. RIndicates that there is no focus information to communicate between widgets. Indicates that this widget is a subwidget of a widget that is in focus. Thus, this widget too is in focus, and this widget should pass HasFocus forward. The WidgetID for any given widget is dynamic based on how many focusable widgets are active at the moment. It is designed basically as a counter that focusable widgets will automatically (via the focusable function) increment. The Focus type helps focusable widgets communicate with each other about which widget is in focus. It consists of a WidgetID and a FocusInfo. FThe dirty bit is a bit to indicate if the widget needs to be redrawn. dMore complicated layouts can be manually constructed with direct access to the Layout data type. wStretch and hStretch specify how much stretching space (in comparative units) in the width and height should be allocated for this widget. wFixed and hFixed specify how much non-stretching space (in pixels) of width and height should be allocated for this widget. qwMin and hMin specify minimum values (in pixels) of width and height for the widget's stretchy dimensions. lFill specifies how much expanding space (in comparative units) this widget should fill out in excess space that would otherwise be unused. A dimension can either be: %Fixed with a size measured in pixels 'Stretchy with a minimum size in pixels !Flow determines widget ordering. -A rendering context specifies the following: %A layout direction to flow widgets. A rectangle bound of current drawing area to render a UI component. It specifies the max size of a widget, not the actual size. It's up to each individual widget to decide where in this bound to put itself. 0A flag to tell whether we are in a conjoined state or not. A conjoined context will duplicate itself for subcomponents rather than splitting. This can be useful for making compound widgets when one widget takes up space and the other performs some side effect having to do with that space. ;The termination procedure is simply a potential IO action. -The null termination procedure is no action. 1A method for merging two termination procedures. Layouts for individual widgets typically come in a few standard flavors, so we have this convenience function for their creation. This function takes layout information for first the horizontal dimension and then the vertical. `The null layout is useful for "widgets" that do not appear or take up space on the screen. -Divides the CTX among the two given layouts. Merge two layouts into one. Merging two graphics can be achieved with overGraphic, but the mergeGraphic function additionally constrains the graphics based on their layouts and the context. TODO: Make sure this works as well as it should ?The global IORef storing the state of all current key presses. This should be called by the GUI engine (GLUT) whenever the user presses or releases a key/button. As long as it is called every time, it will keep an accurate key state. sThis is a convenience function that tests whether either of the right or left shift keys is in the given list. uThis is a convenience function that tests whether either of the right or left control keys is in the given list. qThis is a convenience function that tests whether either of the right or left alt keys is in the given list. ^Checks the global key state to determine whether the given key is currently pressed down. jHorizontal Layout information Vertical Layout information The Key pressed/released. $True if pressed, False if released. The updated key state. im# (c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental NonedThe WindowData object is used for communication between the logic (UISF) and the window (GLUT). UThis action allows a caller to set the current Graphic to display along with a 6 indicating if the Graphic needs to be redrawn. nThis action retrieves the active window. For now, this is used both to check if the GUI is still running (a result of Nothing indicates that it is not) and to externally close the window. Note that if GLUT closes the window (e.g. the user clicks the close button), this reference will be updated to Nothing to prevent double closure.  This action retrieves the window's current dimensions. There is no way to set this value outside of the initial dimension provided by openWindow (perhaps a future feature).  This action retrieves the next keyboard/mouse event to be processed. In the case that there is no new event, NoUIEvent is provided.  This action peeks at the next keyboard/mouse event to be processed. In the case that there is no new event, NoUIEvent is provided. This was added for a potential performance boost.  cThis action retrieves the number of real time seconds that have elapsed since the GUI began.  This function creates the GUI window. It takes as arguments a default background color, a title for the window, and the initial dimensions for the window; it produces a WindowData object to use as communication to the window. TNote that the main GLUT loop is run in a separate OS thread produced by forkOS. NWhen provided with an active window, this function will close the window. 5Set the default background color for the GUI window. $The callback to update the display. nWhen the GUI is idle, we should check if the dirty bit is set. If so, we signal a redraw of the display. When the window is resized, we perform this mess to make sure everything is drawn properly. This model assumes no stretching and instead forces the user to deal with exact pixel sizes. 8When a keyboard or mouse event comes in, send it to the S object for external processing. Also, update the global keyState so that 4 and the has***Modifier functions work as expected. 1When the mouse moves at all, add an event to the  for external processing. 8When the window closes, update the window stored in the . kConverts the GUI's elapsed time from GLUT's integral millisecond standard into floating point seconds. cThis function takes the current dimensions of the window (necessary for the bounding operation bu) and a Graphic and produces the OpenGL IO action that actually performs the rendering. Two notes about it: Currently, it is using  for rendering text. I have had some trouble with nesting uses of PreservingMatrix and scissoring, so bounded graphics (and perhaps other graphic transformations in general) may be a little buggy. 2Convert GLUT's key codes to UISF's internal ones.                        (c) Daniel Winograd-Cort 2014(see the LICENSE file in the distributiondwc@cs.yale.edu experimentalNone246CThe UIParams data type provides an interface for modifying some of the settings for runUI without forcing runUI to take a zillion arguments. Typical usage will be to modify the below defaultUIParams using record syntax.An initialization action.A termination action.The UI window's title.The size of the UI window.The initial Flow setting.How long the UI will sleep between clock ticks if no events are detected. This should be probably be set to O(milliseconds), but it can be set to 0 for better performance (but also higher CPU usage)DShould the UI window close when the user presses the escape key?.The default color of the UI window background.Lift an IO source to UISF.Lift an IO sink to UISF. Lift an IO pipe to UISF.!)Lift an IO source to an event-based UISF."'Lift an IO sink to an event-based UISF.#'Lift an IO pipe to an event-based UISF.$ Get the time signal from a UISF.%Get the context signal from a UISF. This has been deprecated in favor of withCTX as it can provide misleading information.&'Provide the context signal to the UISF.'#Get the UIEvent signal from a UISF.(Get the focus data from a UISF.)&Add a termination procedure to a UISF.*#Get the mouse position from a UISF.+7This function creates a UISF with the given parameters.2!Set a new layout for this widget.3\A convenience function for setLayout, setSize sets the layout to a fixed size (in pixels).4"Add space padding around a widget.5>This is the default UIParams value and what is used in runUI'.6'Run the UISF with the default settings.7'Run the UISF with the given parameters.5 !"#$%&'()*+,-./01234567' !"#$%&'()*+,-./01234567/ !"#$%&'()*+./,-01234576)  !"#$%&'()*+,-./01234567 (c) Daniel Winograd-Cort 2015 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental NoneC8,Default padding between border and content. 98The default assumed background color of the GUI window. :$An infix shorthand for overGraphic. ;<A nice way to make a graphic under only certain conditions. <;Tests whether a Point is within the bounds of a rectangle. =mkWidget is a helper function to make stateful widgets easier to write. In essence, it breaks down the idea of a widget into 4 constituent components: state, layout, computation, and drawing. As =Y allows for making stateful widgets, the first parameter is simply the initial state. The layout is the static layout that this widget will use. It cannot be dependent on any streaming arguments, but a layout can have "stretchy" sides so that it can expand/shrink to fit an area. Learn more about making layouts in UIType6s UI Layout section -- specifically, check out the  function and the  data type. The computation is where the logic of the widget is held. This function takes as input the streaming argument a, the widget's state, a Rect of coordinates indicating the area that has been allotted for this widget, and the G that is triggering this widget's activation (see the definition of  in SOE). The output consists of the streaming output, the new state, and the dirty bit, which represents whether the widget needs to be redrawn. BLastly, the drawing routine takes the same Rect as the computation, a Bool that is true when this widget is in focus and false otherwise, and the current state of the widget (technically, this state is the one freshly returned from the computation). Its output is the Graphic that this widget should display. >OOccasionally, one may want to display a non-interactive graphic in the UI. >m facilitates this. It takes a layout and a simple drawing routine and produces a non-interacting widget. ?-The toggle is useful in the creation of both checkboxes and radio buttons. It displays on/off according to its input, and when the mouse is clicked on it, it will output True (otherwise it outputs False). uThe UISF returned from a call to toggle accepts the state stream and returns whether the toggle is being clicked. @FThe mkSlider widget builder is useful in the creation of all sliders. Akcyclebox is a clickable widget that cycles through a predefined set set of appearances/output values. BwcycleboxS is a cyclebox that additionally accepts input events that can set it to a particular appearance/output. CMaking a widget focusable makes it accessible to tabbing and allows it to see any mouse button clicks and keystrokes when it is actually in focus. D Although mouse button clicks and keystrokes will be available once a widget marks itself as focusable, the widget may also simply want to know whether it is currently in focus to change its appearance. This can be achieved with the following signal function. EA convenience function for making a box that appears to have a shadow. This is accomplished by using four colors representing: :(Top outside, Top inside, Bottom inside, Bottom Outside). 2This is designed to be used with the below values F, G, and H. FA F E$ appears as if it is pushed inward. GA G E appears as if it pops outward. HA H Ej appears somewhat between popped and pushed and is designed to indicate that the box is at the ready. 89:;<=initial state layout  computation drawing routine >layout drawing routine ?Initial state value The layout for the toggle The drawing routine @(True for horizontal, False for vertical 0A function for converting a value to a position 0A function for converting a position to a value `A function for determining how much to jump when a click is on the slider but not the target !The initial value for the slider ABCDEFGH89:;<=>?@ABCDEFGH89:;<=>?@ABCDEFHG89:;<=>?@ABCDEFGH (c) Daniel Winograd-Cort 2014 )see the LICENSE file in the distribution dwc@cs.yale.edu  experimental NoneCE#I8Labels are always left aligned and vertically centered. JDisplayField is an output widget showing the instantaneous value of a signal of Strings. It will show the String over how ever much space it has available to it. The static argument will decide what to cut off in the case where it does not have space to show the entire String: if given True, it will prefer the older characters (cutting off later text), and if given False, it will prefer the newer characters (cutting off older ones. K[DisplayStr is an output widget showing the instantaneous value of a signal of strings. LDdisplay is a widget that takes any show-able value and displays it. MpwithDisplay is a widget modifier that modifies the given widget so that it also displays its output value. NThe textbox widget creates a one line field where users can enter text. It supports mouse clicks and typing as well as the left, right, end, home, delete, and backspace special keys. #The value displayed can be generated by mouse and keyboard events, but it can also be set programmatically by providing the widget's input stream with an event containing the value to display. By using rec and delay, one can update the contents based on e.g. other widgets. <The static argument provides the textbox with initial text. PThe textbox' variant of textbox contains no internal state about the text it displays. Thus, it must be paired with rec and delay and used bidirectionally to be effective. Q|TextFields are like textboxes but can support multiple lines. By default, they are stretchy in the vertical dimension. RWA variant of textField that contains no internal state about the text it displays. S@Title frames a UI by borders, and displays a static title text. Tspacer is an empty widget that will take up empty space without requesting any space. This can be useful for lining up other widgets, for instance if one wants the borders from titles to align even when the titles are bordering widgets of slightly different sizes. UA button is a focusable input widget with a state of being on or off. It can be activated with either a button press, the enter key, or the space key. Buttons also show a static label. hThe regular button is down as long as the mouse button or key press is down and then returns to up. VThe sticky button, on the other hand, once pressed, remains depressed until is is clicked again to be released. Thus, it looks like a button, but it behaves more like a checkbox. W>This variant of stickyButton is settable by its input stream. XlCheckbox allows selection or deselection of an item. It has a static label as well as an initial state. Y:This variant of checkbox is settable by its input stream. Z)The checkGroup widget creates a group of Xes that all send their outputs to the same output stream. It takes a static list of labels for the check boxes and assumes they all start unchecked. yThe output stream is a list of each a value that was paired with a String value for which the check box is checked. \$Radio button presents a list of choices and only one of them can be selected at a time. It takes a static list of choices (as Strings) and the index of the initially selected one, and the widget itself returns the continuous stream representing the index of the selected choice. ]7This variant of radio is settable by its input stream. ^[The listbox widget creates a box with selectable entries. It takes two static values indicating the initial list of data to display and the initial index selected (use -1 for no selection). It takes two event streams that can be used to independently set the list and index. The output stream is the currently selected index. kNote that the index can be greater than the length of the list (simply indicating no choice selected). _This variant of listbox does not keep its list or index stored internally and thus accepts a stream of those values. As such, it requires no static initializing parameters. This can be useful when the list or index are being updated frequently. `Horizontal Continuous Slider aVertical Continuous Slider bHorizontal Discrete Slider cVertical Discrete Slider d&Settable Horizontal Continuous Slider e$Settable Vertical Continuous Slider f$Settable Horizontal Discrete Slider g"Settable Vertical Discrete Slider jkThe realtimeGraph widget creates a graph of the data with trailing values. It takes a dimension parameter, the length of the history of the graph measured in time, and a color for the graphed line. The signal function then takes an input stream of (value,time) event pairs, but since there can be zero or more points at once, we use [] rather than nX for the type. The values in the (value,time) event pairs should be between -1 and 1. kThe histogram widget creates a histogram of the input map. It assumes that the elements are to be displayed linearly and evenly spaced. Also, the values to be plotted must be between 0 and 1 (inclusive). lMThe histogramWithScale widget creates a histogram and an x coordinate scale. mThe scrollable function puts sub-widgets into a virtual canvas that can be scrolled using sliders that appear when necessary. The first argument is the actual layout of the scrollable area, and the second argument is the size of the virtual canvas. nCanvas displays any graphics. The input is a signal of graphics events because we only want to redraw the screen when the input is there. oYcanvas' uses a layout and a graphic generator. This allows it to behave similarly to n4, but it can adjust in cases with stretchy layouts. 'IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno'IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno'IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno'IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno Nonep "$%&'cdefghijklmnopqrstuvwxyz{|}~$,-./234567IJKLMNOQSTUVXZ\^_`abcjklmnopZ675"IKLM$'&%JNQOSTUVXZ\`abcjklm^_no,-./432p$p NoneqFThis example displays the time from the start of the GUI application. rThis example shows off U^s and state by presenting a plus and minus button with a counter that is adjusted by them. sThis example shows off the X widgets. tThis example shows off the \ button widget. u4This example shows off integral sliders (horizontal bs in this case). v<This example shows off both vertical sliders as well as the n widget. The canvas widget can be used to easily create custom graphics in the GUI. Here, it is used to make a color swatch that is controllable with RGB values by the sliders. wThis example shows off the NG widget. Text can be typed in, and that text is transferred to the L- widget below when the button is pressed. {0This is the main demo that incorporates all of the other examples together. In addition to demonstrating how different widgets can connect, it also shows off the tabbing behavior built in to the GUI. Pressing tab cycles through focusable elements, and pressing shift-tab cycles in reverse. qrstuvwxyz{| qrstuvwxyz{| qrstuvwxyz{| qrstuvwxyz{|NoneC<This function will run the crud GUI with the default names.  main = crud This is the main function that creates the crud GUI. It takes an initial database of names as an argument. See notes below on the use of banana brackets and nested do blocks. }~ }~ }~ }~ !"#$%&'()*+,-./0123456789:;<=>??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        ! " # $ % & ' ( ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~           "               UISF-0.4.0.0FRP.UISF.Render.GLUTFRP.UISF.Graphics.TextFRP.UISF.AsynchronyFRP.UISF.AuxFunctionsFRP.UISF.Graphics.ColorFRP.UISF.Graphics.TypesFRP.UISF.Graphics.GraphicFRP.UISF.UITypes FRP.UISF.UISFFRP.UISF.Widget.ConstructionFRP.UISF.WidgetFRP.UISFFRP.UISF.Examples.ExamplesFRP.UISF.Examples.CrudFRP.UISF.Graphics GLUT-2.7.0.2Graphics.UI.GLUT.TypesWindowGraphics.UI.GLUT.Raw.Fonts Fixed8By13 Fixed9By15 TimesRoman10 TimesRoman24 Helvetica10 Helvetica12 Helvetica18 BitmapFontarrows-0.4.4.1#Control.Arrow.Transformer.Automaton AutomatonControl.Arrow.Operationsdelay ArrowCircuitRGBColor DarkBeige MediumBeige LightBeige VLightBeigeGrayWhiteYellowMagentaRedCyanGreenBlueBlack colorToRGBrgbrgbE extractRGBAngleRect DimensionPoint WrapSettingWordWrapCharWrapNoWrapUITextytoUITextUIText unwrapUITuitextToString uitextLen takeUIText dropUIText splitUIText pureUIText appendUIText coloredUIText rgbUIText fontUIText textWidthtextWithinPixels textHeightprepText uitextWords uitextLines textHeight' textWidth'textWithinPixels'Graphic OverGraphicGBoundedGColorGScaleGRotate GTranslateGBezierGEllipseGArcGPolygon GPolyLineGText NoGraphic nullGraphic overGraphictext textLines withColor withColor'ellipse shearEllipselinepolygonpolyline polybezierarc circleFilled circleOutlinerectangleFilledrectangleOutlinetranslateGraphic rotateGraphic scaleGraphic boundGraphicBufferOperationSetBufferTempoSetBufferPlayStatusAppendToBuffer MergeInBufferSkipAheadInBuffer ClearBufferNoBOpTempoDeltaTTimeSEvent getDeltaT accumTimeconstAconstSFedgeaccumuniqueholdnowmergeE~++concatAfoldA runDynamicfoldSFmaybeAevMapfdelayvdelayfcdelayvcdelaytimer genEvents eventBuffer eventBuffer'ArrowIOliftAIO initialAIO terminalAIOstatefulFunctionToAutomatonactionToIOAutostatefulActionToIOAutopureAutoToIOAutoasyncVasyncVOnasyncVT asyncVTOnasyncEasyncEOnasyncEIO asyncEIOOnasyncCasyncCOnasyncCIO asyncCIOOn MouseButtonAdditionalButton WheelDownWheelUp RightButton MiddleButton LeftButton SpecialKey KeyUnknown KeyBackspaceKeyEscKeyTabKeyEnterKeyAltRKeyAltLKeyCtrlRKeyCtrlL KeyShiftR KeyShiftL KeyDeleteKeyBegin KeyNumLock KeyInsertKeyEndKeyHome KeyPageDown KeyPageUpKeyDownKeyRightKeyUpKeyLeftKeyF12KeyF11KeyF10KeyF9KeyF8KeyF7KeyF6KeyF5KeyF4KeyF3KeyF2KeyF1KeyCharUIEvent NoUIEvent MouseMoveButtonptmbuttonSKeyskeychar modifiersisDown FocusInfo DenyFocus SetFocusToNoFocusHasFocusWidgetIDFocusDirtyBitLayoutwStretchhStretchwFixedhFixedwMinhMinlFill NullLayout LayoutTypeFixed fixedSizeStretchyminSizeFlow RightLeft LeftRightBottomUpTopDownCTXflowbounds isConjoinedTerminationProcnullTPmergeTP makeLayout nullLayout divideCTX mergeLayout mergeGraphicsupdateKeyStatehasShiftModifierhasCtrlModifierhasAltModifier isKeyPressed WindowData setGraphics getWindow getWindowDim getNextEvent peekNextEventgetElapsedGUITime openWindow closeWindowrenderGraphicInOpenGL glutKeyToKeyUIParams uiInitializeuiCloseuiTitleuiSize uiInitFlow uiTickDelay uiCloseOnEsc uiBackgroundUISF uisfLayoutuisfFun uisfSourceuisfSinkuisfPipe uisfSourceE uisfSinkE uisfPipeE getDeltaTimegetCTXwithCTX getEvents getFocusDataaddTerminationProcgetMousePositionmkUISFtopDownbottomUp leftRight rightLeftconjoin unconjoin setLayoutsetSizepaddefaultUIParamsrunUI'runUIpaddingbg//whenGinsidemkWidget mkBasicWidgettogglemkSlidercyclebox cycleboxS focusable isInFocus shadowBoxpushedpoppedmarkedlabel displayField displayStrdisplay withDisplaytextboxtextboxEtextbox' textField textField'titlespacerbutton stickyButton stickyButtonScheckbox checkboxS checkGroup checkGroupSradioradioSlistboxlistbox'hSlidervSliderhiSliderviSliderhSliderSvSliderS hiSliderS viSliderSslideriSlider realtimeGraph histogramhistogramWithScale scrollablecanvascanvas'getTimetimeExbuttonEx checkboxEx radioButtonEx shoppinglist colorDemo textboxdemouitextuitext' uitextdemomain linesWith NameEntry firstNamelastNameDatabase deleteFromDBupdateDB defaultnamescrudcrudUISF $fEqNameEntry$fShowNameEntry $fNFDataRGB $fShowRGB $fNFDataColor emptyUIText isEmptyUIText unwrapUITextywrapTextbase Data.Listwordslines uitextLines' uitextWords' uitSplitter getFontHeight getFontArray makeCharArray defaultFont fixed8By13 fixed9By15 timesRoman10 timesRoman24 helvetica10 helvetica12 helvetica18roman monoRoman $fUITexty[]$fUITextyUIText$fIsStringUIText$fNFDataUIText$fNFDataBitmapFont normaliseRectsegment$fNFDataGraphicquantize=>>->>.|.snapshot snapshot_IOAutoPureAuto GHC.Conc.SyncforkOnghc-prim GHC.TypesIO asyncVHelper asyncEHelperasyncEIOHelper asyncCHelperasyncCIOHelperkeyStatesetBackgroundColor displayCBidleCB reshapeCBkeyboardMouseCBmotionCBcloseCBguiTimevertexvertexRvectorvectorR modifyFlow modifyCTX defaultCTX defaultFocus resetFocus$fShowUIParams$fArrowReaderDoubleUISF $fArrowIOUISF$fArrowCircuitUISF$fArrowChoiceUISF$fArrowLoopUISF $fArrowUISF$fCategory*UISF Control.Arrowarrfirstapp|||loop***Kleisli ArrowChoiceControl.Category>>>leftApp^<<<<^>>^^>>returnA&&&secondArrow runKleisli zeroArrow ArrowZero<+> ArrowPlus+++rightleft ArrowApply ArrowMonad ArrowLoop<<<