File tree 1 file changed +16
-1
lines changed
1 file changed +16
-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,17 @@ unsafeHook = Render
115
123
unsafeRenderEffect :: forall a . Effect a -> Pure a
116
124
unsafeRenderEffect = Render
117
125
118
- -- | Discards
126
+ -- | An effect-less hook.
127
+ -- |
128
+ -- | In practice, this is used in cases where the effects of a hook need to be
129
+ -- | hidden).
119
130
type Pure a
120
131
= forall hooks . Render hooks hooks a
121
132
133
+ -- | A hook that stacks effectsrepresented by `newHook`.
134
+ -- |
135
+ -- | Adds the effect(s) represented by `newHook` to the top of the stack of
136
+ -- | effects that occur in a given `Render`.
122
137
type Hook (newHook :: Type -> Type ) a
123
138
= forall hooks . Render hooks (newHook hooks ) a
124
139
You can’t perform that action at this time.
0 commit comments