summaryrefslogtreecommitdiff
path: root/src/GF/CF/CFIdent.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-03-24 15:09:06 +0000
committeraarne <unknown>2004-03-24 15:09:06 +0000
commitdc71ffcf5bae1f2b91467de273c71e7c3294acb3 (patch)
treea4e705bba717aa9f7421c000cfa5756d5eb8462b /src/GF/CF/CFIdent.hs
parent31836c0da9ba7a716ee0480e6219d771da4999fa (diff)
Restoring old functionality
Diffstat (limited to 'src/GF/CF/CFIdent.hs')
-rw-r--r--src/GF/CF/CFIdent.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/GF/CF/CFIdent.hs b/src/GF/CF/CFIdent.hs
index 99ab711e4..95d532e2d 100644
--- a/src/GF/CF/CFIdent.hs
+++ b/src/GF/CF/CFIdent.hs
@@ -68,6 +68,10 @@ varCFFun = mkCFFun . AV
consCFFun :: CIdent -> CFFun
consCFFun = mkCFFun . AC
+-- standard way of making cf fun
+string2CFFun :: String -> String -> CFFun
+string2CFFun m c = consCFFun $ mkCIdent m c
+
stringCFFun :: String -> CFFun
stringCFFun = mkCFFun . AS
@@ -80,6 +84,9 @@ dummyCFFun = varCFFun $ identC "_" --- used in lexer-by-need rules
cfFun2String :: CFFun -> String
cfFun2String (CFFun (f,_)) = prt f
+cfFun2Ident :: CFFun -> Ident
+cfFun2Ident (CFFun (f,_)) = identC $ prt_ f ---
+
cfFun2Profile :: CFFun -> Profile
cfFun2Profile (CFFun (_,p)) = p
@@ -131,6 +138,9 @@ moduleOfCFCat (CFCat (CIQ m _, _)) = m
cfCat2Cat :: CFCat -> (Ident,Ident)
cfCat2Cat (CFCat (CIQ m c,_)) = (m,c)
+cfCat2Ident :: CFCat -> Ident
+cfCat2Ident = snd . cfCat2Cat
+
lexCFCat :: CFCat -> CFCat
lexCFCat cat = ident2CFCat (uncurry CIQ (cfCat2Cat cat)) (identC "*")