just did a map using two lists as input! logic programming is cooool
having fun playing with makam:
Conversation
Having too much fun with Makam…
3
3
It's interesting that check and synth end up having the same signature here...
1
1
yeah, they have different modes though - like:
check : in -> in -> in -> mode.
synth : in -> in -> out -> mode.
(if Makam had support for this, like in Mercury)
2
Are modes restrictive or merely descriptive? Like, if you try to use `check` to synthesize a type, will it (a) fail with some bad error message, where an explicit mode would've resulted in a better one, or (b) succeed, but you'd've preferred it didn't by specifying the mode?
1
(Or do they have some other purpose besides these?)
1
Replying to
Makam does not have modes - this was invented syntax, hehe. In the case of Mecury it uses them to generate different implementations of the same predicate. You can have multiple mode decls for the same predicate. If you try to use a mode that is not in that list it's an error.
This is in contrast to Makam and Prolog where the information seems to flow (?) dynamically. This is more expressive than Mercury, but harder to make run fast, from speaking to Mercury folks at work.
1
1
In my tests I'm sometimes using `check` with an output mode so that I can cover both check and synth at the same time, but that fails for more complicated terms that could be ambiguous (Makam will try searching forever I think?) gist.github.com/brendanzab/7a3
1
1
Show replies
Replying to
Yeah I had that much, I was just wondering what their purpose generally is / what Makam is missing. Apparently it's also a performance thing, interesting :)
Like, could Makam make its parsers run backwards (which they mention being prohibitively expensive) if only it had modes?
1

