forked from GitHub/gf-core
marked alternatives for compiling tables
This commit is contained in:
@@ -281,7 +281,8 @@ computeTermOpt rec gr = comp where
|
|||||||
T i@(TComp ty) cs -> do
|
T i@(TComp ty) cs -> do
|
||||||
-- if there are no variables, don't even go inside
|
-- if there are no variables, don't even go inside
|
||||||
cs' <- if (null g) then return cs else mapPairsM (comp g) cs
|
cs' <- if (null g) then return cs else mapPairsM (comp g) cs
|
||||||
return $ {- V ty (map snd cs') --- -} T i cs'
|
---- return $ V ty (map snd cs')
|
||||||
|
return $ T i cs'
|
||||||
--- this means some extra work; should implement TSh directly
|
--- this means some extra work; should implement TSh directly
|
||||||
TSh i cs -> comp g $ T i [(p,v) | (ps,v) <- cs, p <- ps]
|
TSh i cs -> comp g $ T i [(p,v) | (ps,v) <- cs, p <- ps]
|
||||||
|
|
||||||
@@ -296,8 +297,8 @@ computeTermOpt rec gr = comp where
|
|||||||
ts <- mapM (\ (c,g') -> comp (g' ++ g) c) sts
|
ts <- mapM (\ (c,g') -> comp (g' ++ g) c) sts
|
||||||
ps <- mapM term2patt vs
|
ps <- mapM term2patt vs
|
||||||
let ps' = ps --- PT ptyp (head ps) : tail ps
|
let ps' = ps --- PT ptyp (head ps) : tail ps
|
||||||
return $ ---- V ptyp ts -- to save space, just course of values
|
---- return $ V ptyp ts -- to save space, just course of values
|
||||||
T (TComp ptyp) (zip ps' ts)
|
return $ T (TComp ptyp) (zip ps' ts)
|
||||||
_ -> do
|
_ -> do
|
||||||
cs' <- mapM (compBranch g) cs
|
cs' <- mapM (compBranch g) cs
|
||||||
return $ T i cs' -- happens with variable types
|
return $ T i cs' -- happens with variable types
|
||||||
|
|||||||
Reference in New Issue
Block a user