summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/GrammarToCanonical.hs
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2019-03-13 01:51:26 +0100
committerThomas Hallgren <th-github@altocumulus.org>2019-03-13 01:51:26 +0100
commitb11d7d93dcb22b26564f49158414f07f1bd3f4cc (patch)
tree1c61f7824920b3661e8750804f51b096a0ad62fa /src/compiler/GF/Compile/GrammarToCanonical.hs
parentba9aeb33228b70185e92cdd192408587349e83de (diff)
GF.Grammar.Canonical: some Functor/Foldable/Traversable instances
Diffstat (limited to 'src/compiler/GF/Compile/GrammarToCanonical.hs')
-rw-r--r--src/compiler/GF/Compile/GrammarToCanonical.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/GF/Compile/GrammarToCanonical.hs b/src/compiler/GF/Compile/GrammarToCanonical.hs
index 7442bd495..3b21f7702 100644
--- a/src/compiler/GF/Compile/GrammarToCanonical.hs
+++ b/src/compiler/GF/Compile/GrammarToCanonical.hs
@@ -151,7 +151,7 @@ convert' gr vs = ppT
case t of
-- Abs b x t -> ...
-- V ty ts -> VTableValue (convType ty) (map ppT ts)
- V ty ts -> TableValue (convType ty) [TableRowValue (ppP p) (ppT t)|(p,t)<-zip ps ts]
+ V ty ts -> TableValue (convType ty) [TableRow (ppP p) (ppT t)|(p,t)<-zip ps ts]
where
Ok pts = allParamValues gr ty
Ok ps = mapM term2patt pts
@@ -174,7 +174,7 @@ convert' gr vs = ppT
Alts t' vs -> alts vs (ppT t')
_ -> error $ "convert' "++show t
- ppCase (p,t) = TableRowValue (ppP p) (ppTv (patVars p++vs) t)
+ ppCase (p,t) = TableRow (ppP p) (ppTv (patVars p++vs) t)
ppPredef n =
case predef n of
@@ -249,19 +249,19 @@ proj r l =
selection t v =
case t of
TableValue tt r ->
- case nub [rv|TableRowValue _ rv<-keep] of
+ case nub [rv|TableRow _ rv<-keep] of
[rv] -> rv
_ -> Selection (TableValue tt r') v
where
r' = if null discard
then r
- else keep++[TableRowValue WildPattern impossible]
+ else keep++[TableRow WildPattern impossible]
(keep,discard) = partition (mightMatchRow v) r
_ -> Selection t v
impossible = ErrorValue "impossible"
-mightMatchRow v (TableRowValue p _) =
+mightMatchRow v (TableRow p _) =
case p of
WildPattern -> True
_ -> mightMatch v p