From 026857614235f6a81858b60e2e7c4d5d14d001d5 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 21 Apr 2006 09:14:05 +0000 Subject: embedded haskelle example: query --- src/GF/API/GrammarToHaskell.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/GF/API') 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 +++++ -- cgit v1.2.3