[switch alias expansion to use new newtype representation in followAlias[es]
John Meacham <john@repetae.net>**20061109032803] hunk ./DataConstructors.hs 11
-    followAlias,
-    expandAliases,
hunk ./DataConstructors.hs 138
-getProduct dataTable e | (ELit LitCons { litName = cn, litArgs = _, litType = _ }) <- followAliases dataTable e, Just c <- getConstructor cn dataTable = f c where
+getProduct dataTable e | (ELit LitCons { litName = cn }) <- followAliases dataTable e, Just c <- getConstructor cn dataTable = f c where
hunk ./DataConstructors.hs 368
+    {-
+
hunk ./DataConstructors.hs 391
+    -}
+
+followAlias :: Monad m => DataTable -> E -> m E
+followAlias _ (ELit LitCons { litAliasFor = Just af, litArgs = as }) = return (foldl eAp af as)
+followAlias _  _ = fail "followAlias: not alias"
+
+followAliases :: DataTable -> E -> E
+followAliases _dataTable e = f e where
+    f (ELit LitCons { litAliasFor = Just af, litArgs = as }) = f (foldl eAp af as)
+    f e = e
+
hunk ./DataConstructors.hs 671
-expandAliases :: DataTableMonad m => E -> m E
-expandAliases e = do
-    dt <- getDataTable
-    return (followAliases dt e)
hunk ./E/FromHs.hs 217
-        valToPat' (ELit LitCons { litName = x, litArgs = ts, litType = t }) = ELit $ litCons { litName = x, litArgs = [ EVar (tVr j (getType z)) | z <- ts | j <- [2,4 ..], j `notElem` map tvrIdent args], litType = t }
+        valToPat' (ELit LitCons { litAliasFor = af,  litName = x, litArgs = ts, litType = t }) = ELit $ litCons { litAliasFor = af, litName = x, litArgs = [ EVar (tVr j (getType z)) | z <- ts | j <- [2,4 ..], j `notElem` map tvrIdent args], litType = t }