|
|
|
|
|
by colanderman
2780 days ago
|
|
Mercury is the love child of Haskell and Prolog: that is, a very strongly typed logic language. However, it's not quite as flexible a logic language as Prolog (owing mostly to its strong typechecking and modality system), so in practice it's closer to a Haskell with a different I/O containment mechanism (uniqueness types instead of monads) and the ability to sometimes write reversible functions if you bang your head against the modality system hard enough. Its compiler is impressive, and is capable of acts such as compiling certain non-tail-recursive functions in a tail-recursive manner, or even transforming them into tail-recursive equivalents, given the right hints. All this capability comes at a cost. At least as of ~4 years ago, the error messages the compiler can spit out over modality errors dwarf even those from C++ templates. And compiler bugs/unimplemented features are not unheard of. |
|
I wanted to learn it recently, but couldn't find enough example programs.