File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ import Type.Equality (class TypeEquals)
23
23
-- | body, i.e. during "render". This includes hooks and ends with
24
24
-- | returning JSX (see `pure`), but does not allow arbitrary side
25
25
-- | effects.
26
+ -- |
27
+ -- | The `x` and `y` type arguments represent the stack of effects that this
28
+ -- | `Render` implements, with `x` being the stack at the start of this
29
+ -- | `Render`, and `y` the stack at the end.
30
+ -- |
31
+ -- | See
32
+ -- | [purescript-indexed-monad](https://pursuit.purescript.org/packages/purescript-indexed-monad)
33
+ -- | to understand how the order of the stack is enforced at the type level.
26
34
newtype Render x y a
27
35
= Render (Effect a )
28
36
@@ -115,10 +123,16 @@ unsafeHook = Render
115
123
unsafeRenderEffect :: forall a . Effect a -> Pure a
116
124
unsafeRenderEffect = Render
117
125
118
- -- | Discards
126
+ -- | Type alias used to lift otherwise pure functionality into the Render type.
127
+ -- | Not commonly used.
119
128
type Pure a
120
129
= forall hooks . Render hooks hooks a
121
130
131
+ -- | Type alias for Render representing a hook.
132
+ -- |
133
+ -- | The `newHook` argument is a type constructor which takes a set of existing
134
+ -- | effects and generates a type with a new set of effects (produced by this
135
+ -- | hook) stacked on top.
122
136
type Hook (newHook :: Type -> Type ) a
123
137
= forall hooks . Render hooks (newHook hooks ) a
124
138
You can’t perform that action at this time.
0 commit comments