Hacker News new | ask | show | jobs
by tluyben2 2628 days ago
I mentioned to my Haskell teacher in uni that I did 2 years of intensive Prolog for an AI course at another uni and so that I grasp the basics or ‘everything recursion’ (mind you, this is 25 years or so ago). He got angry and said the two have nothing in common and if I believe that I definitely should pay more attention. It was weird as I did not say they are alike; just that they share some concepts which are usually hard to understand for imperative programmers, but, after 2 years of breathing Prolog really are second nature.
3 comments

Sibling comment is spot on. Your "teacher" was either not well informed or dealing with some issues himself.

To cathartically let go of that experience, I suggest reading up on Curry, the logical language extension to Haskell: https://en.wikipedia.org/wiki/Curry_(programming_language)

Honestly, that speaks more about the teacher's personal issues than it does about the similarities between logic and purely functional programming. I'm sorry that you had to experience that.
Waaaaaat. There's so much in Haskell's type system that is also in logic programming. Like Hindley-Milner type inference and type class instance resolution.