[Bugfix in Expressions, problems when unifying ragged lists in TExp
martin.hofmann@uni-bamberg.de**20090421095922] hunk ./src/Syntax/Expressions.hs 383
-                if null ragged -- check if we have ragged liss at all
-                  then return $ TListE straightai ty -- we can keep the f***ing ListE
-                          -- convert back to lists, to get correct variable image
+                if (null ragged) then return $ TListE straightai ty
+                 -- check if we have ragged list at allm and if so we can keep the f***ing ListE
hunk ./src/Syntax/Expressions.hs 386
---                          llogDE $ text "List have different length"
---                          llogDE $ text "Antinunified subterms (ragged) are :" <> pretty straightai
-                          -- here we need the the prefix style
-                          let tcone = TConE '(:) (mkArrowT [ety, ty, ty]) 
-                          let apps = map (mkTAppE tcone) straightai
-                          
-                          return $ foldTAppE1 (apps ++ [raggedai])                                     
+                          -- convert back to lists, to get correct variable image
+                          if (null straight) then return raggedai
+                            else do
+                              -- iff there are straight, we add them in 'cons' style 
+    --                          llogDE $ text "List have different length"
+    --                          llogDE $ text "Antinunified subterms (ragged) are :" <> pretty straightai
+                                let tcone = TConE '(:) (mkArrowT [ety, ty, ty]) 
+                                let sections = map ((mkTInfixE tcone) . Just) straightai
+                                return $ foldTInfixE sections raggedai
hunk ./src/Syntax/Expressions.hs 518
-    liftM  (foldTAppE op) (applyAtIndex args i f)
+    liftM (foldTAppE op) (applyAtIndex args i f)
hunk ./src/Syntax/Expressions.hs 984
+mkTInfixE c l r = let
+    ty = case (l,r) of
+            (Just _,Just _)   -> last . unArrowT . typeOf $ c
+            (Nothing,Just _)  -> mkArrowT . (drop 0) . unArrowT . typeOf $ c
+            (Just _,Nothing)  -> mkArrowT . (drop 1) . unArrowT . typeOf $ c
+            (Nothing,Nothing) -> typeOf c 
+    in TInfixE l c r ty
+    
+foldTInfixE [] _ = error "foldTInfixE: empty list of sections!"    
+foldTInfixE sections lastarg = 
+    foldr1 (\l r -> l . Just . r) sections $ Just lastarg
hunk ./src/Syntax/Types.hs 82
-splitArrowT :: Type -> (Type,Type)
-splitArrowT (AppT (AppT ArrowT a1) a2) = (a1,a2)
-splitArrowT t = error $ "Cannot split " ++ (show t)
hunk ./src/Syntax/Types.hs 83
-sectionType  = fst . splitArrowT
-argumentType = snd . splitArrowT
+-- erroneous
+--splitArrowT :: Type -> (Type,Type)
+--splitArrowT (AppT (AppT ArrowT a1) a2) = (a1,a2)
+--splitArrowT t = error $ "Cannot split " ++ (show t)
+
+sectionType  = mkArrowT . tail . unArrowT
+argumentType = head . unArrowT