diff options
| author | aarne <aarne@cs.chalmers.se> | 2005-11-23 21:38:11 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2005-11-23 21:38:11 +0000 |
| commit | 2f8514e54ab4548f4938fe2cc73d824da2fb14bc (patch) | |
| tree | a82674b4e206a824b8ce12abb494b740c17262e0 /src | |
| parent | fe0408c9a448407855152afea6a6767c93b00d2d (diff) | |
extending proto resource API
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Formalism/SimpleGFC.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/GF/Formalism/SimpleGFC.hs b/src/GF/Formalism/SimpleGFC.hs index f3a51e7db..c98884a3c 100644 --- a/src/GF/Formalism/SimpleGFC.hs +++ b/src/GF/Formalism/SimpleGFC.hs @@ -179,13 +179,16 @@ Path path ++. lbl = Path (Left lbl : path) (++!) :: Path c t -> Term c t -> Path c t Path path ++! sel = Path (Right sel : path) -lintypeFollowPath :: Path c t -> LinType c t -> LinType c t +lintypeFollowPath :: (Show c,Show t) => Path c t -> LinType c t -> LinType c t lintypeFollowPath (Path path) = follow path 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 + --- by AR for debugging 23/11/2005 termFollowPath :: (Eq c, Eq t) => Path c t -> Term c t -> Term c t termFollowPath (Path path) = follow (reverse path) |
