@@ -90,7 +90,7 @@ foreign import listen :: Http2Server -> OptionsObject -> Effect Unit -> Effect U
9090
9191--  | https://nodejs.org/docs/latest/api/http2.html#serverclosecallback
9292closeServer  ::  Http2Server  ->  Effect  Unit  ->  Effect  Unit 
93- closeServer = unsafeCoerce  Internal .closeServer
93+ closeServer http2server =  Internal .closeServer (unsafeCoerce http2server) 
9494
9595--  | https://nodejs.org/docs/latest/api/net.html#event-close
9696--  |
@@ -99,7 +99,7 @@ closeServer = unsafeCoerce Internal.closeServer
9999--  | Returns an effect for removing the event listener before the event
100100--  | is raised.
101101onceCloseServer  ::  Http2Server  ->  Effect  Unit  ->  Effect  (Effect  Unit )
102- onceCloseServer = unsafeCoerce  Internal .onceServerClose
102+ onceCloseServer http2server =  Internal .onceServerClose (unsafeCoerce http2server) 
103103
104104--  | An HTTP/2 server with one listening socket for encrypted connections.
105105--  |
@@ -113,11 +113,11 @@ foreign import createSecureServer :: OptionsObject -> Effect Http2SecureServer
113113
114114--  | https://nodejs.org/docs/latest/api/net.html#serverlistenoptions-callback
115115listenSecure  ::  Http2SecureServer  ->  OptionsObject  ->  Effect  Unit  ->  Effect  Unit 
116- listenSecure =  unsafeCoerce listen 
116+ listenSecure http2server = listen ( unsafeCoerce http2server) 
117117
118118--  | https://nodejs.org/docs/latest/api/http2.html#serverclosecallback
119119closeServerSecure  ::  Http2SecureServer  ->  Effect  Unit  ->  Effect  Unit 
120- closeServerSecure = unsafeCoerce  Internal .closeServer
120+ closeServerSecure http2server =  Internal .closeServer (unsafeCoerce http2server) 
121121
122122--  | https://nodejs.org/docs/latest/api/net.html#event-close
123123--  |
@@ -126,23 +126,23 @@ closeServerSecure = unsafeCoerce Internal.closeServer
126126--  | Returns an effect for removing the event listener before the event
127127--  | is raised.
128128onceCloseServerSecure  ::  Http2SecureServer  ->  Effect  Unit  ->  Effect  (Effect  Unit )
129- onceCloseServerSecure = unsafeCoerce  Internal .onceServerClose
129+ onceCloseServerSecure http2server =  Internal .onceServerClose (unsafeCoerce http2server) 
130130
131131--  | https://nodejs.org/docs/latest/api/net.html#event-error
132132--  |
133133--  |  the 'close' event will not be emitted directly following this event unless server.close() is manually called.
134134--  |
135135--  | Returns an effect for removing the event listener.
136136onErrorServer  ::  Http2Server  ->  (Error  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
137- onErrorServer = unsafeCoerce  Internal .onEmitterError
137+ onErrorServer http2server =  Internal .onEmitterError (unsafeCoerce http2server) 
138138
139139--  | https://nodejs.org/docs/latest/api/net.html#event-error
140140--  |
141141--  |  the 'close' event will not be emitted directly following this event unless server.close() is manually called.
142142--  |
143143--  | Returns an effect for removing the event listener.
144144onErrorServerSecure  ::  Http2SecureServer  ->  (Error  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
145- onErrorServerSecure = unsafeCoerce  Internal .onEmitterError
145+ onErrorServerSecure http2server =  Internal .onEmitterError (unsafeCoerce http2server) 
146146
147147--  | https://nodejs.org/docs/latest/api/http2.html#class-serverhttp2session
148148--  |
@@ -169,11 +169,11 @@ foreign import onceSession :: Http2Server -> (ServerHttp2Session -> Effect Unit)
169169
170170--  | https://nodejs.org/api/http2.html#http2sessionlocalsettings
171171localSettings  ::  ServerHttp2Session  ->  Effect  SettingsObject 
172- localSettings = unsafeCoerce  Internal .localSettings
172+ localSettings http2session =  Internal .localSettings (unsafeCoerce http2session) 
173173
174174--  | https://nodejs.org/docs/latest/api/http2.html#http2sessionclosecallback
175175closeSession  ::  ServerHttp2Session  ->  Effect  Unit  ->  Effect  Unit 
176- closeSession = unsafeCoerce  Internal .closeSession
176+ closeSession http2session =  Internal .closeSession (unsafeCoerce http2session) 
177177
178178--  | Listen for one event, call the callback, then remove
179179--  | the event listener.
@@ -183,13 +183,13 @@ closeSession = unsafeCoerce Internal.closeSession
183183--  |
184184--  | https://nodejs.org/docs/latest/api/http2.html#event-stream
185185onceStream  ::  Http2Server  ->  (ServerHttp2Stream  ->  HeadersObject  ->  Flags  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
186- onceStream = unsafeCoerce  Internal .onceStream
186+ onceStream http2server callback =  Internal .onceStream (unsafeCoerce http2server) (\http2stream  ->  callback (unsafeCoerce http2stream)) 
187187
188188--  | https://nodejs.org/docs/latest/api/http2.html#event-stream
189189--  |
190190--  | Returns an effect for removing the event listener.
191191onStream  ::  Http2Server  ->  (ServerHttp2Stream  ->  HeadersObject  ->  Flags  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
192- onStream = unsafeCoerce  Internal .onStream
192+ onStream http2server callback =  Internal .onStream (unsafeCoerce http2server) (\http2stream  ->  callback (unsafeCoerce http2stream)) 
193193
194194--  | Listen for one event, call the callback, then remove
195195--  | the event listener.
@@ -199,26 +199,26 @@ onStream = unsafeCoerce Internal.onStream
199199--  |
200200--  | https://nodejs.org/docs/latest/api/http2.html#event-stream
201201onceStreamSecure  ::  Http2SecureServer  ->  (ServerHttp2Stream  ->  HeadersObject  ->  Flags  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
202- onceStreamSecure = unsafeCoerce  Internal .onceStream
202+ onceStreamSecure http2server callback =  Internal .onceStream (unsafeCoerce http2server) (\http2stream  ->  callback (unsafeCoerce http2stream)) 
203203
204204--  | https://nodejs.org/docs/latest/api/http2.html#event-stream
205205--  |
206206--  | Returns an effect for removing the event listener.
207207onStreamSecure  ::  Http2SecureServer  ->  (ServerHttp2Stream  ->  HeadersObject  ->  Flags  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
208- onStreamSecure = unsafeCoerce  Internal .onStream
208+ onStreamSecure http2server callback =  Internal .onStream (unsafeCoerce http2server) (\http2stream  ->  callback (unsafeCoerce http2stream)) 
209209
210210--  | https://nodejs.org/docs/latest/api/http2.html#http2streamrespondheaders-options
211211respond  ::  ServerHttp2Stream  ->  HeadersObject  ->  OptionsObject  ->  Effect  Unit 
212- respond = unsafeCoerce  Internal .respond
212+ respond http2stream =  Internal .respond (unsafeCoerce http2stream) 
213213
214214--  | https://nodejs.org/docs/latest/api/http2.html#event-session_1
215215--  |
216216--  | Listen for one event, then remove the event listener.
217217--  |
218218--  | Returns an effect for removing the event listener before the event
219219--  | is raised.
220- onceSessionSecure  ::  Http2SecureServer  ->  (ServerHttp2Session  ->  Effect  Unit ) ->  Effect  Unit 
221- onceSessionSecure =  unsafeCoerce onceSession 
220+ onceSessionSecure  ::  Http2SecureServer  ->  (ServerHttp2Session  ->  Effect  Unit ) ->  Effect  ( Effect   Unit ) 
221+ onceSessionSecure http2server = onceSession ( unsafeCoerce http2server) 
222222
223223--  | An HTTP/2 server `Http2Stream` connected to a client.
224224--  |
@@ -242,7 +242,7 @@ foreign import pushStream :: ServerHttp2Stream -> HeadersObject -> OptionsObject
242242--  | Returns an effect for removing the event listener before the event
243243--  | is raised.
244244onceTrailers  ::  ServerHttp2Stream  ->  (HeadersObject  ->  Flags  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
245- onceTrailers = unsafeCoerce  Internal .onceTrailers
245+ onceTrailers http2stream =  Internal .onceTrailers (unsafeCoerce http2stream) 
246246
247247--  | https://nodejs.org/docs/latest/api/http2.html#http2streamadditionalheadersheaders
248248foreign  import  additionalHeaders  ::  ServerHttp2Stream  ->  HeadersObject  ->  Effect  Unit 
@@ -254,7 +254,7 @@ foreign import additionalHeaders :: ServerHttp2Stream -> HeadersObject -> Effect
254254--  | Returns an effect for removing the event listener before the event
255255--  | is raised.
256256onceErrorStream  ::  ServerHttp2Stream  ->  (Error  ->  Effect  Unit ) ->  Effect  (Effect  Unit )
257- onceErrorStream = unsafeCoerce  Internal .onceEmitterError
257+ onceErrorStream http2stream =  Internal .onceEmitterError (unsafeCoerce http2stream) 
258258
259259--  | https://nodejs.org/docs/latest/api/http2.html#event-wanttrailers
260260--  |
@@ -263,13 +263,13 @@ onceErrorStream = unsafeCoerce Internal.onceEmitterError
263263--  | Returns an effect for removing the event listener before the event
264264--  | is raised.
265265onceWantTrailers  ::  ServerHttp2Stream  ->  Effect  Unit  ->  Effect  (Effect  Unit )
266- onceWantTrailers = unsafeCoerce  Internal .onceWantTrailers
266+ onceWantTrailers http2stream =  Internal .onceWantTrailers (unsafeCoerce http2stream) 
267267
268268--  | https://nodejs.org/docs/latest/api/http2.html#http2streamsendtrailersheaders
269269--  |
270270--  | > When sending a request or sending a response, the `options.waitForTrailers` option must be set in order to keep the `Http2Stream` open after the final `DATA` frame so that trailers can be sent.
271271sendTrailers  ::  ServerHttp2Stream  ->  HeadersObject  ->  Effect  Unit 
272- sendTrailers = unsafeCoerce  Internal .sendTrailers
272+ sendTrailers http2stream =  Internal .sendTrailers (unsafeCoerce http2stream) 
273273
274274--  | https://nodejs.org/docs/latest/api/net.html#event-end
275275--  |
@@ -278,11 +278,11 @@ sendTrailers = unsafeCoerce Internal.sendTrailers
278278--  | Returns an effect for removing the event listener before the event
279279--  | is raised.
280280onceEnd  ::  ServerHttp2Stream  ->  Effect  Unit  ->  Effect  (Effect  Unit )
281- onceEnd = unsafeCoerce  Internal .onceEnd
281+ onceEnd http2stream =  Internal .onceEnd (unsafeCoerce http2stream) 
282282
283283--  | https://nodejs.org/docs/latest/api/http2.html#http2streamclosecode-callback
284284closeStream  ::  ServerHttp2Stream  ->  Int  ->  Effect  Unit  ->  Effect  Unit 
285- closeStream stream code  = Internal .closeStream (unsafeCoerce stream) code 
285+ closeStream stream = Internal .closeStream (unsafeCoerce stream)
286286
287287--  | Coerce to a duplex stream.
288288toDuplex  ::  ServerHttp2Stream  ->  Duplex 
0 commit comments