Wrap a record in Box before passing it to the host, to work around an ABI issue

This commit is contained in:
Brian Carroll 2022-07-17 15:19:16 +01:00
parent 3c506eb79c
commit c50cbd265a
No known key found for this signature in database
GPG Key ID: 9CF4E3BF9C4722C7
2 changed files with 3 additions and 2 deletions

View File

@ -7,4 +7,4 @@ putLine : Str -> Effect {}
getLine : Effect Str
sendRequest : Request -> Effect Response
sendRequest : Box Request -> Effect Response

View File

@ -104,6 +104,7 @@ errorToString = \err ->
send : Request -> Task Str Error [Network [Http]*]*
send = \req ->
Effect.sendRequest req
# TODO: Fix our C ABI codegen so that we don't this Box.box heap allocation
Effect.sendRequest (Box.box req)
|> Effect.map handleStringResponse
|> InternalTask.fromEffect