summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2005-11-24 09:25:39 +0000
committeraarne <aarne@cs.chalmers.se>2005-11-24 09:25:39 +0000
commit9a9d057a34c33f353eb3936c3a996f93df3bce8d (patch)
tree3449fab2697960932da354724871b1a37e295668 /src/GF
parent2f8514e54ab4548f4938fe2cc73d824da2fb14bc (diff)
simple problem tracing
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Formalism/SimpleGFC.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/GF/Formalism/SimpleGFC.hs b/src/GF/Formalism/SimpleGFC.hs
index c98884a3c..1dcc07be4 100644
--- a/src/GF/Formalism/SimpleGFC.hs
+++ b/src/GF/Formalism/SimpleGFC.hs
@@ -179,15 +179,17 @@ Path path ++. lbl = Path (Left lbl : path)
(++!) :: Path c t -> Term c t -> Path c t
Path path ++! sel = Path (Right sel : path)
-lintypeFollowPath :: (Show c,Show t) => Path c t -> LinType c t -> LinType c t
-lintypeFollowPath (Path path) = follow path
+lintypeFollowPath :: (Print c,Print t) => Path c t -> LinType c t -> LinType c t
+lintypeFollowPath (Path path0) ctype0 = follow path0 ctype0
where follow [] ctype = ctype
follow (Right pat : path) (TblT _ ctype) = follow path ctype
follow (Left lbl : path) (RecT rec)
= maybe err (follow path) $ lookup lbl rec
where err = error $ "lintypeFollowPath: label not in record type"
- ++ "\n" ++ show lbl
- ++ "\n" ++ show rec
+ ++ "\nLabel: " ++ prt lbl
+ ++ "\nPath: " ++ prt (Path path0)
+ ++ "\nCType: " ++ prt ctype0
+ ++ "\nRType: " ++ prt (RecT rec)
--- by AR for debugging 23/11/2005
termFollowPath :: (Eq c, Eq t) => Path c t -> Term c t -> Term c t