A Haskell version of a classic puzzle by John McCarthy.
The Haskell code is a straightforward encoding of the puzzle, using Haskell's functional programming facilities (including lists and comprehehnsions) to encode a brute force search.
It is interesting to note that in a real sense this example shows how to embed logic programming in Haskell, without going to the trouble of embedding a full logic programming language.
Posted to Logic/Declerative by Ehud Lamm on 1/27/03; 12:58:43 AM
|