[Haskell-cafe] Define a data structure of a predicate

Robin Green greenrd at greenrd.org
Wed Oct 5 17:13:14 EDT 2005

On Wednesday 05 October 2005 18:13, Sara Kenedy wrote:
> I am a newbie in Haskell. Now I am working on datatype structure of
> Haskell, especially on predicate. Today I try to search on Internet to
> find the reference document but I did not find the specific. If any of
> you know how to define a data structure for the abstract syntax of
> predicate logicI , for example : x^2 + 3*x + 2 > 0, if you don't mind,
> please share with me.

I am working on this problem, although the domain of discourse for me is 
Haskell code, so I guess my problem is probably a much more complicated 
extension of what you want to do. I haven't yet figured out how I want to do 

But I read in an earlier post you want to read in stuff from a GXL file - is 
this still what you want to do, and if so, could you not base your data 
structures on the GXL specification?

In fact, in the Java and Lisp language communities (for example) there is code 
to automatically construct objects corresponding to XML files, without having 
to define any data structures by hand. I would guess that DtdToHaskell 
(mentioned in http://comments.gmane.org/gmane.comp.lang.haskell.cafe/8344 )
is the equivalent in Haskell. This should be an easy way to create data 
structures for your project. Don't create work for yourself when it's not 
necessary! If the generated code that DtdToHaskell generates is good enough 
for your needs, there's no need to rewrite that code by hand.


More information about the Haskell-Cafe mailing list