11--  | This module defines foreign types and functions which wrap React's functionality.
22
3- module  React   
3+ module  React 
44  ( UI ()
55  , UIRef ()
6-    
6+ 
77  , EventHandler ()
8-    
8+ 
99  , Disallowed ()
1010  , Read ()
1111  , Write ()
1212  , Only ()
1313  , ReadWrite ()
1414  , ReadOnly ()
15-    
15+ 
1616  , ReactState ()
1717  , ReactProps ()
1818  , ReactRefs ()
19-    
19+ 
2020  , Refs ()
21-    
21+ 
2222  , Render ()
23-    
23+ 
2424  , UISpec ()
25-    
25+ 
2626  , Event ()
2727  , MouseEvent ()
2828  , KeyboardEvent ()
29-    
29+ 
3030  , EventHandlerContext ()
31-    
31+ 
3232  , spec 
33-    
33+ 
3434  , getProps 
3535  , getRefs 
36-    
36+ 
3737  , readState 
3838  , writeState 
3939  , transformState 
40-    
40+ 
4141  , mkUI 
42-    
42+ 
4343  , handle 
44-    
44+ 
4545  , renderToString 
4646  , renderToBody 
4747  , renderToElementById 
@@ -103,13 +103,13 @@ foreign import data Refs :: *
103103foreign  import  data  Event  :: *
104104
105105--  | The type of mouse events.
106- type  MouseEvent  =   
106+ type  MouseEvent  = 
107107  {  pageX  ::  Number 
108-   , pageY  ::  Number   
108+   , pageY  ::  Number 
109109  } 
110110
111111--  | The type of keyboard events.
112- type  KeyboardEvent  =   
112+ type  KeyboardEvent  = 
113113  {  altKey    ::  Boolean 
114114  , ctrlKey   ::  Boolean 
115115  , charCode  ::  Int 
@@ -124,7 +124,7 @@ type KeyboardEvent =
124124  } 
125125
126126--  | A function which handles events.
127- type  EventHandlerContext  eff  props  state  result  =    
127+ type  EventHandlerContext  eff  props  state  result  = 
128128  Eff  ( props  ::  ReactProps  props 
129129      , refs  ::  ReactRefs  ReadOnly 
130130      , state  ::  ReactState  ReadWrite  state 
@@ -143,6 +143,7 @@ type Render props state eff =
143143--  | A specification of a component.
144144type  UISpec  props  state  eff  = 
145145  {  render  ::  Render  props  state  eff 
146+   , displayName  ::  String 
146147  , getInitialState 
147148      :: UIRef  -> 
148149         Eff  ( props  ::  ReactProps  props 
@@ -205,6 +206,7 @@ type UISpec props state eff =
205206spec  ::  forall  props  state  eff . state  ->  Render  props  state  eff  ->  UISpec  props  state  eff 
206207spec st render =
207208  { render:                    render
209+   , displayName:               " " 
208210  , getInitialState:           \_ ->  pure st
209211  , componentWillMount:        \_ ->  return unit
210212  , componentDidMount:         \_ ->  return unit
@@ -216,30 +218,30 @@ spec st render =
216218  }
217219
218220--  | Read the component props.
219- foreign  import  getProps  ::  forall  props  eff .  
220-                              UIRef  ->   
221+ foreign  import  getProps  ::  forall  props  eff .
222+                              UIRef  -> 
221223                             Eff  (props  ::  ReactProps  props  | eff ) props 
222224
223225--  | Read the component refs.
224226foreign  import  getRefs  ::  forall  write  eff .
225-                             UIRef  ->   
227+                             UIRef  -> 
226228                            Eff  (refs  ::  ReactRefs  (Read  write ) | eff ) Refs 
227229
228230--  | Write the component state.
229- foreign  import  writeState  ::  forall  state  eff .  
230-                                UIRef  ->   
231-                                state  ->   
231+ foreign  import  writeState  ::  forall  state  eff .
232+                                UIRef  -> 
233+                                state  -> 
232234                               Eff  (state  ::  ReactState  ReadWrite  state  | eff ) state 
233235
234236--  | Read the component state.
235- foreign  import  readState  ::  forall  state  write  eff .  
237+ foreign  import  readState  ::  forall  state  write  eff .
236238                              UIRef  -> 
237239                              Eff  (state  ::  ReactState  (Read  write ) state  | eff ) state 
238240
239241--  | Transform the component state by applying a function.
240- transformState  ::  forall  state  statePerms  eff .  
242+ transformState  ::  forall  state  statePerms  eff .
241243                    UIRef  -> 
242-                     (state  ->  state ) ->   
244+                     (state  ->  state ) -> 
243245                    Eff  (state  ::  ReactState  ReadWrite  state  | eff ) state 
244246transformState ctx f = do 
245247  state <-  readState ctx
@@ -248,7 +250,7 @@ transformState ctx f = do
248250--  | Create a component from a component spec.
249251foreign  import  mkUI  ::  forall  props  state  eff .
250252                         UISpec  props  state  eff  -> 
251-                          props  ->   
253+                          props  -> 
252254                         UI 
253255
254256--  | Create an event handler.
0 commit comments