so this Opa thing is picking up.
Im starting a Server like this:
function resource request_dispatch(Uri.relative p_url,
p_log_fun) {
//type Uri.relative = {list(string) path, list((string,string)) query }
match (p_url) {
case {path: [] ... } : get_standard_page(p_log_fun);
case {path: ["_rest_" | path] ...}: api_request_handler(path,p_log_fun);
case {~path ...} : Resource.page("Regular",<div>standard page</div>);
}
}
function start_server(p_log_fun) {
function resource dispatch_handler_fun(Uri.relative p_url) {
request_dispatch(p_url,p_log_fun)
}
Server.start(Server.http,
{ title : "Hello, world",
dispatch:dispatch_handler_fun})
}
however Im getting:
Error: File "src/posts_viewer.opa", line 71, characters 3-150, (71:3-74:42 | 2466-2613)
Type Conflict
(72:10-74:41) {dispatch: (Uri.relative -> resource); title: string } /
'c.a
(71:3-71:8) Server.handler
The second argument of function should be of type
{ dispatch: (Uri.relative -> resource); title: string } / 'c.a
instead of
Server.handler
so its clearly dispatch_handler_fun is not of the correct type signature. in the API docs I can see that Server.handler in a variant http://doc.opalang.org/type/stdlib.core.web.server/Server/handler
is it clear to anyone why dispatch_handler_fun is not appropriate here?
ps. sorry for the bad code formating :)
thank you