@@ -65,32 +65,32 @@ module React
65
65
) where
66
66
67
67
import Prelude
68
- import Control.Monad.Eff (Eff )
68
+ import Control.Monad.Eff (kind Effect , Eff )
69
69
import Unsafe.Coerce (unsafeCoerce )
70
70
71
71
-- | Name of a tag.
72
72
type TagName = String
73
73
74
74
-- | A virtual DOM node, or component.
75
- foreign import data ReactElement :: *
75
+ foreign import data ReactElement :: Type
76
76
77
77
-- | A mounted react component
78
- foreign import data ReactComponent :: *
78
+ foreign import data ReactComponent :: Type
79
79
80
80
-- | A reference to a component, essentially React's `this`.
81
- foreign import data ReactThis :: * -> * -> *
81
+ foreign import data ReactThis :: Type -> Type -> Type
82
82
83
83
-- | An event handler. The type argument represents the type of the event.
84
- foreign import data EventHandler :: * -> *
84
+ foreign import data EventHandler :: Type -> Type
85
85
86
86
-- | This phantom type indicates that read access to a resource is allowed.
87
- foreign import data Read :: !
87
+ foreign import data Read :: Effect
88
88
89
89
-- | This phantom type indicates that write access to a resource is allowed.
90
- foreign import data Write :: !
90
+ foreign import data Write :: Effect
91
91
92
92
-- | An access synonym which indicates that neither read nor write access are allowed.
93
- type Disallowed = () :: # !
93
+ type Disallowed = () :: # Effect
94
94
95
95
-- | An access synonym which indicates that both read and write access are allowed.
96
96
type ReadWrite = (read :: Read , write :: Write )
@@ -101,21 +101,21 @@ type ReadOnly = (read :: Read)
101
101
-- | This effect indicates that a computation may read or write the component state.
102
102
-- |
103
103
-- | The first type argument is a row of access types (`Read`, `Write`).
104
- foreign import data ReactState :: # ! -> !
104
+ foreign import data ReactState :: # Effect -> Effect
105
105
106
106
-- | This effect indicates that a computation may read the component props.
107
- foreign import data ReactProps :: !
107
+ foreign import data ReactProps :: Effect
108
108
109
109
-- | This effect indicates that a computation may read the component refs.
110
110
-- |
111
111
-- | The first type argument is a row of access types (`Read`, `Write`).
112
- foreign import data ReactRefs :: # ! -> !
112
+ foreign import data ReactRefs :: # Effect -> Effect
113
113
114
114
-- | The type of refs objects.
115
- foreign import data Refs :: *
115
+ foreign import data Refs :: Type
116
116
117
117
-- | The type of DOM events.
118
- foreign import data Event :: *
118
+ foreign import data Event :: Type
119
119
120
120
-- | The type of mouse events.
121
121
type MouseEvent =
@@ -282,7 +282,7 @@ spec' getInitialState renderFn =
282
282
}
283
283
284
284
-- | React class for components.
285
- foreign import data ReactClass :: * -> *
285
+ foreign import data ReactClass :: Type -> Type
286
286
287
287
-- | Read the component props.
288
288
foreign import getProps :: forall props state eff .
@@ -360,7 +360,7 @@ foreign import createFactory :: forall props.
360
360
ReactClass props -> props -> ReactElement
361
361
362
362
-- | Internal representation for the children elements passed to a component
363
- foreign import data Children :: *
363
+ foreign import data Children :: Type
364
364
365
365
-- | Internal conversion function from children elements to an array of React elements
366
366
foreign import childrenToArray :: Children -> Array ReactElement
0 commit comments