summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2019-09-20 16:15:28 +0200
committerkrangelov <kr.angelov@gmail.com>2019-09-20 16:15:28 +0200
commit30eef61f0a400d6b9ec77721620e13b8132a9c2c (patch)
tree2d7db8cc4ff7fc0bc781e3dcb202d493d4706827 /src/compiler/GF/Grammar
parent29662350dcdb350479576dfa099037fd71debc1a (diff)
more dead code
Diffstat (limited to 'src/compiler/GF/Grammar')
-rw-r--r--src/compiler/GF/Grammar/Lookup.hs4
-rw-r--r--src/compiler/GF/Grammar/Macros.hs6
2 files changed, 3 insertions, 7 deletions
diff --git a/src/compiler/GF/Grammar/Lookup.hs b/src/compiler/GF/Grammar/Lookup.hs
index 68c0191ae..9f774fb2c 100644
--- a/src/compiler/GF/Grammar/Lookup.hs
+++ b/src/compiler/GF/Grammar/Lookup.hs
@@ -166,11 +166,11 @@ allParamValues cnc ptyp =
RecType r -> do
let (ls,tys) = unzip $ sortByFst r
tss <- mapM (allParamValues cnc) tys
- return [R (zipAssign ls ts) | ts <- combinations tss]
+ return [R (zipAssign ls ts) | ts <- sequence tss]
Table pt vt -> do
pvs <- allParamValues cnc pt
vvs <- allParamValues cnc vt
- return [V pt ts | ts <- combinations (replicate (length pvs) vvs)]
+ return [V pt ts | ts <- sequence (replicate (length pvs) vvs)]
_ -> raise (render ("cannot find parameter values for" <+> ptyp))
where
-- to normalize records and record types
diff --git a/src/compiler/GF/Grammar/Macros.hs b/src/compiler/GF/Grammar/Macros.hs
index ab2e53473..4c92fae8c 100644
--- a/src/compiler/GF/Grammar/Macros.hs
+++ b/src/compiler/GF/Grammar/Macros.hs
@@ -554,16 +554,12 @@ strsFromTerm t = case t of
return [strTok (str2strings def) vars |
def <- d0,
vars <- [[(str2strings v, map sstr c) | (v,c) <- zip vv c0] |
- vv <- combinations v0]
+ vv <- sequence v0]
]
FV ts -> mapM strsFromTerm ts >>= return . concat
Strs ts -> mapM strsFromTerm ts >>= return . concat
_ -> raise (render ("cannot get Str from term" <+> ppTerm Unqualified 0 t))
--- | to print an Str-denoting term as a string; if the term is of wrong type, the error msg
-stringFromTerm :: Term -> String
-stringFromTerm = err id (ifNull "" (sstr . head)) . strsFromTerm
-
getTableType :: TInfo -> Err Type
getTableType i = case i of
TTyped ty -> return ty