diff options
| author | bjorn <bjorn@bringert.net> | 2008-06-02 15:47:56 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-06-02 15:47:56 +0000 |
| commit | 2771367118994770907597c860cc7c4229496fd3 (patch) | |
| tree | 9282e055585fd3b18470a3fbe243c6efce2df93e /src-3.0/GF/Compile | |
| parent | 5073ac4e7f4c24aa412ed3a3c3d719532df9f637 (diff) | |
Fixed generated Haskell modules to use only the PGF module.
Diffstat (limited to 'src-3.0/GF/Compile')
| -rw-r--r-- | src-3.0/GF/Compile/GFCCtoHaskell.hs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src-3.0/GF/Compile/GFCCtoHaskell.hs b/src-3.0/GF/Compile/GFCCtoHaskell.hs index 72e4cb922..31f1dc0b3 100644 --- a/src-3.0/GF/Compile/GFCCtoHaskell.hs +++ b/src-3.0/GF/Compile/GFCCtoHaskell.hs @@ -48,8 +48,7 @@ haskPreamble name = [ "module " ++ name ++ " where", "", - "import PGF.CId", - "import PGF.Data", + "import PGF", "----------------------------------------------------", "-- automatic translation from GF to Haskell", "----------------------------------------------------", @@ -58,11 +57,11 @@ haskPreamble name = " gf :: a -> Exp", " fg :: Exp -> a", "", - predefInst "GString" "String" "DTr [] (AS s) []", + predefInst "GString" "String" "EStr s", "", - predefInst "GInt" "Integer" "DTr [] (AI s) []", + predefInst "GInt" "Integer" "EInt s", "", - predefInst "GFloat" "Double" "DTr [] (AF s) []", + predefInst "GFloat" "Double" "EFloat s", "", "----------------------------------------------------", "-- below this line machine-generated", @@ -144,7 +143,7 @@ hInstance m (cat,rules) (if length xx == 0 then gId f else prParenth (gId f +++ foldr1 (+++) xx')) +++ "=" +++ mkRHS f xx' mkVars n = ["x" ++ show i | i <- [1..n]] - mkRHS f vars = "DTr [] (AC (CId \"" ++ f ++ "\"))" +++ + mkRHS f vars = "EApp (mkCId \"" ++ f ++ "\")" +++ "[" ++ prTList ", " ["gf" +++ x | x <- vars] ++ "]" @@ -157,9 +156,9 @@ fInstance m (cat,rules) = " _ -> error (\"no" +++ cat ++ " \" ++ show t)" where mkInst f xx = - " DTr [] (AC (CId \"" ++ f ++ "\")) " ++ + " EApp i " ++ "[" ++ prTList "," xx' ++ "]" +++ - "->" +++ mkRHS f xx' + "| i == mkCId \"" ++ f ++ "\" ->" +++ mkRHS f xx' where xx' = ["x" ++ show i | (_,i) <- zip xx [1..]] mkRHS f vars | isListCat (cat,rules) = |
