summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-04-21 09:14:05 +0000
committeraarne <aarne@cs.chalmers.se>2006-04-21 09:14:05 +0000
commit026857614235f6a81858b60e2e7c4d5d14d001d5 (patch)
treeb9aaaa8c4ee2f63e3285701727f54587cc87bd9a /src
parent028561ac2a5a94d3f4058bd2a4e6630c20b4a7cc (diff)
embedded haskelle example: query
Diffstat (limited to 'src')
-rw-r--r--src/GF/API/GrammarToHaskell.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/API/GrammarToHaskell.hs b/src/GF/API/GrammarToHaskell.hs
index 81acdd47c..c3ca33247 100644
--- a/src/GF/API/GrammarToHaskell.hs
+++ b/src/GF/API/GrammarToHaskell.hs
@@ -50,9 +50,11 @@ haskPreamble =
"class Gf a where gf :: a -> Trm",
"class Fg a where fg :: Trm -> a",
"",
- predefInst "String" "K s",
+ predefInst "GString" "String" "K s",
"",
- predefInst "Int" "EInt s",
+ predefInst "GInt" "Integer" "EInt s",
+ "",
+ predefInst "GFloat" "Double" "EFloat s",
"",
"----------------------------------------------------",
"-- below this line machine-generated",
@@ -60,7 +62,7 @@ haskPreamble =
""
]
-predefInst typ patt = let gtyp = gId typ in
+predefInst gtyp typ patt =
"newtype" +++ gtyp +++ "=" +++ gtyp +++ typ +++ " deriving Show" +++++
"instance Gf" +++ gtyp +++ "where" ++++
" gf (" ++ gtyp +++ "s) =" +++ patt +++++