Re: [m-users.] Self-improvement subjects.
"Sean Charles (emacstheviking)" <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
I decided to ask Chat-GPT Volker, it has been most helpful too! In terms of logic programming, what is an existential variable? Can you show me an example in a language called Mercury? And what came back was clear, and explained and so for the rest of the evening, some cheese and biscuits will accompany on my Chat-GPT education about such matters! Thanks! :D > On 23 Oct 2023, at 17:37, Volker Wysk <[email protected]> wrote: > > Am Montag, dem 23.10.2023 um 14:37 +0100 schrieb Sean Charles > (emacstheviking): >> What areas of maths / logic do I need to study to better understand the >> Mercury compiler? >> >> I have a brain, so I have a chance. >> >> What I find mostly confusing is all the talk of 'existential' things, from >> philosophy I know what Existentialism means but not when applied to a >> language like Mercury. > > Existential types (more precisely: types with existentially quantified type > variables in them) gave me a headache, too, at first. I recommend this page: > > https://github.com/Mercury-Language/mercury/wiki/Existential-types > > "Existential" refers to the existential quantifier in such types. As opposed > to the usual implicit universal quantifier (which can be made explicit, but > doesn't need to). > > What that page doesn't say, is that for an existential type you will > probably also need a type class, so you can do more with it. > > You can think of an existential data constructor as a container for a value > that can have any type (possibly restricted to the members of a type class). > That type, encapsulated inside of it, isn't give out to the outside. This > means, it isn't restricted to anything from the outside. > > >> Also I still struggle with modes/inst and 'and-or' trees. I read the >> Wikipedia page on those until it stopped making sense (didn't take long), >> I have rough idea of what the Mercury manual is trying to tell me but I am >> sick and tired of feeling like a semi-educated simpleton and need to up my >> game. >> >> When I learned Prolog, I did some study about Horne clauses, and some >> other related subjects but only enough really to understand what I was >> doing at the time time, and it got me further down the road. >> >> But...Mercury. What a beast! > > Yes, insts are beasty. :-)) > >> I truly want to get to know it's inner dialogue as it once again is forced >> to eat my probably horrendous code over and over. >> >> So... any topic for self-study would be most appreciated. > > Good luck, > Volker _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users