<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>@Aistis</div><div>Thanks :)</div><div><br></div><div>Check the toy here <a href="https://github.com/fabriceleal/urweb-nregex">https://github.com/fabriceleal/urweb-nregex</a></div><div><br></div><div>I tried to coerce my match function to work on the server side my calling it via rpc and giving the value back to the page using a <dyn></div><div>I tried 4 ways of coding the predicates to eval chars but to no good <br></div><div><br></div><div><a href="https://github.com/fabriceleal/urweb-nregex/commit/57eac6de87fe755ab0a0ce2cf03132c99ef92dd1#diff-28f969b3b5e13b5a7230a77f7d879e2eR95">https://github.com/fabriceleal/urweb-nregex/commit/57eac6de87fe755ab0a0ce2cf03132c99ef92dd1#diff-28f969b3b5e13b5a7230a77f7d879e2eR95</a></div><div><br></div><div>previous commit compiles, but uses plain list char and "hardcoded" function calls instead of char -> bool<br></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 20, 2018 at 10:53 PM Fabrice Leal <<a href="mailto:fabrice.leal.ch@gmail.com">fabrice.leal.ch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>@Aistis</div><div>Just doing your snippet won't typecheck for me;</div><div><br></div><div></div><div> I tried like this</div><div><br></div><div>...<br>fun testReR s = return (testRe s)<br> <br>fun index () =<br> r <- rpc (testReR "test 123");<br> return <xml><br>...</div><div><br></div><div>and the error is "Anonymous function remains at code generation" and on top I get "RPC in server-side code"<br></div><div><br></div><div>and I tried like this<br></div><div>...</div><div>fun testReR s = return (testRe s)<br> <br>fun index () =<br> r <- testReR "test 123";<br> return <xml><br> ....<br></div><div><br></div><div>and the error is the same "Anonymous function remains at code generation"</div><div><br></div><div>==</div><div><br></div><div>btw, I started another toy project and I seem unable to use curried functions due to them resulting in the same error<br></div><div></div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 19, 2018 at 9:05 PM Fabrice Leal <<a href="mailto:fabrice.leal.ch@gmail.com" target="_blank">fabrice.leal.ch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>ok so this was itching me so I decided to try to isolate whatever is at fault. and I think I created the simplest sample to reproduce the problem:</div><div><br></div><div><a href="https://github.com/fabriceleal/urweb-test" target="_blank">https://github.com/fabriceleal/urweb-test</a></div><div><br></div><div>so I'm assuming the problem is not at my end and will try to do the parsing on my own until the urweb-regex lib gets updated<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 18, 2018 at 11:01 PM Fabrice Leal <<a href="mailto:fabrice.leal.ch@gmail.com" target="_blank">fabrice.leal.ch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I'm having this weird error while trying to compile urweb using urweb-regex; if I isolate that page in a separate module, it compiles fine (even though I seem unable to access that page from the browser), so I assume I'm doing something wrong in my helloworld.ur file. <br></div><div><br></div><div>Would appreciate some pointers; Source file is this one (<a href="https://github.com/fabriceleal/urweb-experiments/blob/doesnt_compile/helloworld.ur#L869" target="_blank">https://github.com/fabriceleal/urweb-experiments/blob/doesnt_compile/helloworld.ur#L869</a>) and I also included the result of -dumpVerboseSource (<a href="https://github.com/fabriceleal/urweb-experiments/blob/doesnt_compile/dumpVerboseSource.txt#L7705" target="_blank">https://github.com/fabriceleal/urweb-experiments/blob/doesnt_compile/dumpVerboseSource.txt#L7705</a>)</div><div><br></div><div>That FFI maybe_onload is particularly suspicious ... is the call to parsePgn being "lifted" to javascript code? Some time ago I had some errors while trying to use the rpc function in the loadPost page because i was mixing it with code that uses my canvas library which has a bunch of clientOnly FFI calls; I reorganized my code and eventually made it work nicely (<a href="https://github.com/fabriceleal/urweb-experiments/commit/503da7e28f1a05be6e69e9f60c9cd321bfa252ce" target="_blank">https://github.com/fabriceleal/urweb-experiments/commit/503da7e28f1a05be6e69e9f60c9cd321bfa252ce</a> IIRC). I tried to isolate the testParse function but seems to not lead anywhere.</div><div><br></div><div>Sorry for the wall of text and thanks in advance :)<br></div><div><br>-- <br><div dir="ltr" class="m_2125015598792360975m_7144068361370168619m_3732442212593509262gmail_signature"><div dir="ltr"><div><div>---</div><div>Fabrice Leal</div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_2125015598792360975m_7144068361370168619gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>---</div><div>Fabrice Leal</div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_2125015598792360975gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>---</div><div>Fabrice Leal</div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>---</div><div>Fabrice Leal</div></div></div></div>