on develop help sign in
Adjusts Quickref.md to reflect recent changes
88851b5Dave Laing
Quickref.md+4−53
@@ -76,30 +76,7 @@ Note the "list" functions do not imply particular HTML tags (ul, li, etc), thoug
76-- Same as dyn, but takes initial value and an update Event instead of a Dynamic.
76-- Same as dyn, but takes initial value and an update Event instead of a Dynamic.
77[W] widgetHold :: m a -> Event (m a) -> m (Dynamic a)
77[W] widgetHold :: m a -> Event (m a) -> m (Dynamic a)
78
78
79−-- Turn a Dynamic key/value map into a set of dynamically-changing widgets.
79+Also see the "Collection management functions" section in the `reflex` Quick Reference.
80−[W] listWithKey :: Ord k =>
81− Dynamic (Map k v) -> (k -> Dynamic v -> m a ) -> m (Dynamic (Map k a))
82−
83−-- Same as above where the widget constructor doesn't care about the key.
84−[W] list :: Ord k =>
85− Dynamic (Map k v) -> ( Dynamic v -> m a ) -> m (Dynamic (Map k a))
86−
87−-- Even simpler version where there are no keys and we just use a list.
88−[W] simpleList ::
89− Dynamic [v] -> ( Dynamic v -> m a ) -> m (Dynamic [a])
90−
91−-- Like listWithKey specialized for widgets returning (Event a).
92−[W] listViewWithKey :: Ord k =>
93− Dynamic (Map k v) -> (k -> Dynamic v -> m (Event a)) -> m (Event (Map k a))
94−
95−-- Create a dynamically-changing set of widgets, one of which is selected at any time.
96−[W] selectViewListWithKey_ :: Ord k => Dynamic k ->
97− Dynamic (Map k v) -> (k -> Dynamic v -> Dynamic Bool -> m (Event a)) -> m (Event k)
98−
99−-- Same as listWithKey, but takes initial values and an updates Event instead of a Dynamic.
100−[W] listWithKey' :: Ord k =>
101− Map k v -> Event (Map k (Maybe v)) -> (k -> v -> Event v -> m a) -> m (Dynamic (Map k a))
102−```
103
80
104### Utility widgets
81### Utility widgets
105
82
@@ -135,27 +112,12 @@ Some of these widget builders take a configuration record and return a record co
135
112
136## Connecting to the real world (I/O)
113## Connecting to the real world (I/O)
137
114
138−### Connecting to DOM events
139−
140```haskell
115```haskell
141-- Extract the specified Event from an 'El'. See Reflex.Dom.Widget.Basic
116-- Extract the specified Event from an 'El'. See Reflex.Dom.Widget.Basic
142[ ] domEvent :: EventName en -> El -> Event (EventResultType en)
117[ ] domEvent :: EventName en -> El -> Event (EventResultType en)
143```
118```
144
119
145−### Performing arbitrary I/O in response to Events
120+Also see the "Connection to the real world" and "Time" sections in the `reflex` Quick Reference.
146−
147−```haskell
148−-- Run side-effecting actions in Event when it occurs; returned Event contains
149−-- results. Side effects run in (WidgetHost m) monad, which includes [S] and [H]
150−-- and can also do I/O via liftIO
151−[W] performEvent :: Event ( WidgetHost m a) -> m (Event a)
152−
153−-- Just run side-effects; no return Event
154−[W] performEvent_ :: Event ( WidgetHost m ()) -> m ()
155−
156−-- Actions run asynchronously; actions are given a callback to send return values
157−[W] performEventAsync :: Event ((a -> IO ()) -> WidgetHost m ()) -> m (Event a)
158−```
159
121
160### XMLHttpRequest
122### XMLHttpRequest
161
123
@@ -178,16 +140,6 @@ Convenience functions for XMLHttpRequest. see Reflex.Dom.Xhr
178[W] getAndDecode :: FromJSON a => Event Text -> m (Event (Maybe a))
140[W] getAndDecode :: FromJSON a => Event Text -> m (Event (Maybe a))
179```
141```
180
142
181−### Time
182−
183−```haskell
184−-- Create Event at given interval with given basis time.
185−[W] tickLossy :: NominalDiffTime -> UTCTime -> m (Event t TickInfo)
186−
187−-- Delay an Event's occurrences by a given amount in seconds.
188−[W] delay :: NominalDiffTime -> Event t a -> m (Event t a)
189−```
190−
191## Startup
143## Startup
192
144
193```haskell
145```haskell
@@ -201,7 +153,6 @@ Convenience functions for XMLHttpRequest. see Reflex.Dom.Xhr
201[I] mainWidgetWithCss ::
153[I] mainWidgetWithCss ::
202 ByteString ->
154 ByteString ->
203 Widget Spider (Gui Spider (WithWebView SpiderHost) (HostFrame Spider)) () -> IO ()
155 Widget Spider (Gui Spider (WithWebView SpiderHost) (HostFrame Spider)) () -> IO ()
204−
205−-- One-shot Event that is triggered once all initial widgets are built
206−[W] getPostBuild :: m (Event ())
207```
156```
157+
158+Also see the corresponding section in the `reflex` Quick Reference.