On Feb 9, 2008 2:12 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'd like to build a database model with winHugs that allows
> a "recursive relation". For example a single instance of
> entity "components" is related with at least another row of
> the entity "components" (1 to many relationship). How can I
> do that?
A very simple approach is to use a recursive data type:
data Relation = Relate Component [Component]
If components store their relations, then
data Component = Component { related :: Maybe [Component] }
There are much more complicated but type-safe approaches too. What are
you looking to do?
Justin
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe