Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"module could not be loaded" (Curry) in GenServer example #448

Closed
smarwei opened this issue Feb 28, 2021 · 3 comments
Closed

"module could not be loaded" (Curry) in GenServer example #448

smarwei opened this issue Feb 28, 2021 · 3 comments
Assignees

Comments

@smarwei
Copy link

smarwei commented Feb 28, 2021

I tried to call the example server from an Erlang shell, but could not get it to work.
I'm running ubuntu 18.04 and installed hamler 0.2.2 using the dpkg package.

Before starting the server I registered the node with
start :"hamler@127.0.0.1"

In the Erlang shell I then just executed
gen_server:call({server, 'hamler@127.0.0.1'}, {'Query'}).

Hamler then throws
`
=ERROR REPORT==== 28-Feb-2021::13:13:30.052963 ===
** Generic server server terminating
** Last message in was {'Query'}
** When Server state == {proxy,#{handleCall => #Fun<Demo.Server.3.83583961>,
handleCast => #Fun<Demo.Server.4.83583961>},
{'State',20}}
** Reason for termination ==
** {'module could not be loaded',
[{'Curry',apply,
[#Fun<Demo.Server.3.83583961>,
[{'Query'},
{<8914.93.0>,#Ref<8914.1897630177.680787969.90452>},
{'State',20}]],
[]},
{'Control.Behaviour.GenServer.Proxy',handle_call,3,[]},
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,715}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,744}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}
** Client <8914.93.0> is remote on node 'erlang@127.0.0.1'

=CRASH REPORT==== 28-Feb-2021::13:13:30.056272 ===
crasher:
initial call: 'Control.Behaviour.GenServer.Proxy':init/1
pid: <0.83.0>
registered_name: server
exception error: undefined function 'Curry':apply/2
in function 'Control.Behaviour.GenServer.Proxy':handle_call/3
in call from gen_server:try_handle_call/4 (gen_server.erl, line 715)
in call from gen_server:handle_msg/6 (gen_server.erl, line 744)
ancestors: [<0.9.0>]
message_queue_len: 0
messages: []
links: [<0.9.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 4185
stack_size: 28
reductions: 8111
neighbours:
`

@niltok niltok self-assigned this Feb 28, 2021
@smarwei
Copy link
Author

smarwei commented Feb 28, 2021

The Erlang part is actually not relevant.
This triggers the problem as well:
`
module Main where

import Prelude
import Demo.Server as Server

main :: IO ()
main = do
_ <- Server.start
_ <- Server.query
pure ()
`

@smarwei
Copy link
Author

smarwei commented Mar 1, 2021

After installing hamler from source the example is (almost) working.

The only problem left is that it seems that "return" is no longer supported.
After replacing "return" with "pure" in the example code everything works fine.

Many thanks for your great work!

@niltok
Copy link
Contributor

niltok commented Mar 3, 2021

thx for your testing! and return removed like idris because of its confusing name & same usage as pure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants