Pattern Matching - Prolog vs. Haskell

前端 未结 5 1930
再見小時候
再見小時候 2021-02-02 07:42

This is not a homework question, rather an exam study guide question. What is the difference between pattern matching in Prolog Vs Haskell?

I\'ve done some research and

5条回答
  •  我在风中等你
    2021-02-02 08:12

    Adding to the answer of LeleDumbo, we could say that Prolog unification builds terms as well as deconstructs them, while in Haskell the build phase is conveniently demanded to returned value.

    Of course such feature is what allows in pure Prolog so called 'bidirectional' predicates, exploited for instance in DCGs, that with some restriction, can be used for both parse and generation.

提交回复
热议问题