7 | --------------------------------------------------------------------------------
8 | -- Commands
9 | --------------------------------------------------------------------------------
11 | ||| A `Cmd` (abbreviation of "command") is a (typically effectful) computation
12 | ||| which might send an arbitrary number of events of type `e` to an event
13 | ||| handler synchronously or asynchronously.
14 | |||
15 | ||| Commands are used as the primary means of setting up (interactive) UI
16 | ||| components and running effectful computations.
17 | |||
18 | ||| Module `Web.MVC.View` provides various commands for creating, modifying
19 | ||| and deleting interactive DOM elements.
20 | |||
21 | ||| Module `Web.MVC.Animate` has commands for firing events at regular
22 | ||| intervals and for running animations.
23 | |||
24 | ||| Module `Web.MVC.Http` has commands for sending requests to and
25 | ||| firing events upon receiving responses from HTTP servers.
35 | export
43 | ||| Wraps a batch of commands in a single command by
44 | ||| installing each command sequentially.
45 | |||
46 | ||| This function is stack safe.
47 | export
51 | ||| Wrap an effectful computation in a command.
52 | |||
53 | ||| The produced result is fired synchronously.
58 | ||| Wrap an effectful computation in a command.
59 | |||
60 | ||| The produced result is fired synchronously.
65 | ||| Wrap an effectful computation in a command.
66 | |||
67 | ||| This will never fire an event.
72 | ||| Wrap an effectful computation in a command.
73 | |||
74 | ||| This will never fire an event.
79 | ||| Fires the given event once, synchronously.
84 | ||| A command that produces no event.
85 | |||
86 | ||| This will never fire an event.
91 | ||| Use the given command conditionally.
92 | |||
93 | ||| If the boolean flag is `False`, this will return the
94 | ||| empty command (`noAction`).
95 | export
100 | ||| Convert a value in a `Maybe` to a `Cmd e`.
101 | |||
102 | ||| Returns the empty command in case of a `Nothing`.
103 | export