<div dir="ltr"><div><div><div><div><div>I was hoping someone might have a better answer than I did, and hopefully smarter people will promptly issue any needed corrections :)<br><br>There _is_ a tutorial here:<br><a href="https://www.mercurylang.org/documentation/documentation.html">https://www.mercurylang.org/documentation/documentation.html</a><br><br></div>I found the first few examples to be very useful, but then it jumped right into a decryption thing, which was counter productive to me. This has generally been a problem with functional language books in my experience though.<br><br></div>Mercury happens to be nearly exactly like Prologue though, and I found the following book to be very useful to me as well: <a href="https://books.google.com/books/about/Programming_in_Prolog.html?id=wuERBwAAQBAJ&source=kp_cover&hl=en">https://books.google.com/books/about/Programming_in_Prolog.html?id=wuERBwAAQBAJ&source=kp_cover&hl=en</a><br><br></div>There is a lot of really brilliant work that makes Mercury totally awesome. You should ignore all of that while learning the basic language. In particular, skipping DCG's and different language targets is completely safe, but you still have to know that "!IO" is really compiler magic for two parameters when looking up function calls.<br><br></div><div>Skip anything about Lambda's and Higher Order Programming until you've got quite a lot of XP, they are cool and important, but if you aren't comfortable with functions and predicates, they'll totally just get in the way.<br><br></div><div>Skip trying to define your own types for now, stick to programs that use the built in ones.<br></div><div><br></div><div>You need to know that Variables NEVER get reassigned to (remember that !IO is compiler magic) and that this is a very good thing, though it'll probably drive you mad if you think your wasting a bunch of RAM with all the variables (I've not ever seen this cause any noticeable memory consumption, and I've stopped reassigning variables in all my other code as well whenever possible).<br></div><div><br></div><div>Finally, there is a very subtle difference between predicates and functions. For me, I just stuck with predicates for a long time and ignored functions. I think it's probably a pretty good route to go, since Mercury tends to take up a lot of space horizontally.<br></div><div><br><br></div>If you know nothing at all about programing in general, Mercury may not be the best language to learn in. It's got a bit of "magic" you need to know about up front (the !IO stuff for instance) and you'll need to know the difference between a modules public interface and it's implementation. There is also a lot of "chatter" that isn't needed for very simple programs that gets in the way of learning.<br><br></div>Personally, I've found Python to be the easiest language for a beginner to learn in, just don't get caught up in the idea that it's the right solution to every problem. In my experience Python has been very bad at any program of scale. But beginners need to write lots of small programs anyway. Once you get variables, and functions well understood in Python, they'll make a lot more sense in mercury (though they aren't quite the same thing they are based on the same underlying concepts).<br><div><div><div><div><div><br><br><div>Good Luck!<br><br></div><div>Charles<br></div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 18, 2017 at 10:20 AM, Echedey López Romero <span dir="ltr"><<a href="mailto:elr@openmailbox.org" target="_blank">elr@openmailbox.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi users.<br>
<br>
How can i to learn Mercury lang?<br>
<br>
I didn't find any complete documentation or tutorial for people that<br>
want to learn from scratch.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Regards,<br>
Echedey López Romero<br>
<br>
______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.mercurylang.org">users@lists.mercurylang.org</a><br>
<a href="https://lists.mercurylang.org/listinfo/users" rel="noreferrer" target="_blank">https://lists.mercurylang.org/<wbr>listinfo/users</a><br>
</font></span></blockquote></div><br></div>