|
|
On Thu, 27 Mar 2008 17:59:24 +0000, Orchid XP v7 wrote:
>>> Heh. You wanna know how it works? ;-)
>>
>> Well, I read the message you wrote, and that seemed to cover a fair bit
>> of it. But sure, I'd be interested in more details....
>
> OK, well, I'm sure once I've posted this Darren will tell me I've done
> it all wrong, but hey. :-)
Well, you don't learn without making mistakes (that's not "you" as in
*you*, it's "you" as in pretty much everybody. :-) )
> [As should be superbly obvious, I got all the techniques out of a book.
> Obviously I'm not this intelligent on my own. All the code, however, I
> wrote myself...]
Well, don't knock yourself. I don't even have a book on the topic, so
you're one step ahead of me there.
> So that's unification, and that's how you check whether two expressions
> are or can be made equal. [Incidentally, this is apparently the
> algorithm Haskell uses for automatically determining what type
> signitures your program should have. Each item has a type, which might
> be a specific type like "Integer", or something involving a type
> variable, and the compiler needs to check it's possible to unify
> everything and determine the most general types, etc.]
OK, with you so far....
> Now, if only I could make it so you don't have to write a Haskell
> program every time you want to execute a logic predicate, I'd get round
> to doing stuff like the example where you define who's related to who,
> and then you can ask the computer whether somebody is or isn't a direct
> descendent of somebody else. [But without actually implementing the
> inferance algorithm yourself.] Neat stuff...
That is pretty cool - even if the concepts came out of a book,
implementing them is something entirely different - you seem to
understand this stuff quite well...
Jim
Post a reply to this message
|
|