[Haskell-cafe] Re: [Haskell] What's up with this Haskell runtime error message:

Jared Updike jupdike at gmail.com
Thu Apr 6 12:03:07 EDT 2006


> Thanks so much for your help. I should have made clear that I was aware that
> the definitions were mutually dependent.  What I was hoping was that Haskell
> could solve this for me without my having to resort to effectively finessing
> any sequencing considerations.

Haskell is a functional language. The program you are trying to solve
sounds like a logic problem if I understand it correctly. There is a
functional logic programming language called Curry [1] that has
similar syntax to Haskell, but a different evaluation approach. (Note:
I don't know anything about Curry other than what I read on the front
page of their website, and the fact that someone wrote a Sudoku solver
by writing the constraints and having the compiler generate a program
that solves the puzzle.)

>  Perhaps I am really asking it to do too much.

What you want is a program that looks for a set of values that satisfy
a certain set of mathematical relations (you mentioned scientific
computing). As I understand it, this is where logic programming
shines. (If you can turn this into a system of equations, Mathematica
might be able to solve it, btw.)

>  This I thought might be reasonable since one is supposed to be achieving a
> sequence-less style of programming.

I never really heard Haskell described this way. I've heard Haskell
described as a declarative programming language, where you shouldn't
worry about the order of execution of your functions, but I never
thought it meant anything about complete sequence-less-ness; it seems
very rooted in deterministic evaluation.

> But this would seem to be a counter
> example where  I will be essentially forced to implement a sequential
> processing semantic in a language environment which ostensibly would deny me
> such (for my own good I understand).

In fact, Haskell is big on sequencing. One of the key features of
Haskell is the monad [2]; you might call it sequencing done right. I'm
not sure how monads would help you (if you can express your code
imperatively you are good to go, but it sounds like you want to keep
things declarative).

>  Thoughts?

Someone who knows about logic programming might point you to good
resources about this perspective, if it applies (other than Curry
[1]), which looks pretty fun.

Hope that helps,
  Jared.

[1] http://www.informatik.uni-kiel.de/~curry/
[2] http://www.nomaware.com/monads/html/

--
http://www.updike.org/~jared/
reverse ")-:"


More information about the Haskell-Cafe mailing list