[add routine to find product data types
John Meacham <john@repetae.net>**20051017234100] hunk ./DataConstructors.hs 3
-    getConstructor,
-    toDataTable,
hunk ./DataConstructors.hs 4
-    showDataTable,
-    slotTypes,
-    lookupCType,
-    lookupCType',
hunk ./DataConstructors.hs 5
-    typesCompatable,
+    getConstructor,
hunk ./DataConstructors.hs 7
-    getSiblings
+    getProduct,
+    getSiblings,
+    lookupCType,
+    lookupCType',
+    showDataTable,
+    slotTypes,
+    toDataTable,
+    typesCompatable
hunk ./DataConstructors.hs 91
+
+-- | return the single constructor of product types
+
+getProduct :: Monad m => DataTable -> E -> m Constructor
+getProduct dataTable e | (ELit (LitCons cn _ _)) <- followAliases dataTable e, Just c <- getConstructor cn dataTable = f c where
+    f c | Just [x] <- conChildren c = getConstructor x dataTable
+        | otherwise = fail "Not Product type"
+getProduct _ _ = fail "Not Product type"