[Haskell-cafe] Re: Interesting feature

Benjamin L.Russell DekuDekuplex at Yahoo.com
Tue Jul 8 07:00:04 EDT 2008

On Tue, 8 Jul 2008 16:59:00 +1000, "David Overton"
<david at overtons.id.au> wrote:

>Also, see my recent attempts at (constraint) logic programming in Haskell:

Whoops!  Sorry, I rushed to reply with my earlier message, and forgot
to respond to this part of your post.

Your blog posts about a Haskell Sudoku solver remind me of similar
blog posts about Sudoku solvers in Python (see "Solving Every Sudoku
Puzzle": http://norvig.com/sudoku.html) and Scheme (see "Schemely:
Sudoku Solver1":
http://www.bobmc.net/cgi-bin/Schemely.pl/Sudoku_Solver1, and "Schemely
Blog: Scheme Sudoku Solver":
http://schemely.blogspot.com/2006/02/scheme-sudoku-solver.html).  Some
programmers learn new languages by translating code for Sudoku solvers
from one language that they already know well to another language that
they are trying to learn.

Because solving a Sudoku puzzle can be accomplished more easily by
using constraint propagation, in which placing a constraint on one
square can cause further constraints to be placed on other squares,
this definition lends itself to constraint programming.  Since
constraint programming is a form of declarative programming, this form
of programming lends itself to constraint logic programming.  As an
example, GNU Prolog has a constraint logic programming interpreter;
however, GNU Prolog lacks strong typing.

If you are interested in constraint programming, you may wish to
investigate the multi-paradigm programming language Oz (see
http://www.mozart-oz.org/), which can implement constraints in a
functional programming language.  The language lacks multiprocessor
support, but supports declarative programming, object-oriented
programming, constraint programming, and concurrency as part of a
coherent whole.

-- Benjamin L. Russell

More information about the Haskell-Cafe mailing list