Data.Generics question
Dear all, in Data.Generics.Text http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/base/Data/Generi... I find this nice example gshow = ( \t -> "(" ++ showConstr (toConstr t) ++ concat (gmapQ ((++) " " . gshow) t) ++ ")" ) `extQ` (show :: String -> String) but I couldn't figure out how to use this to declare a useful show instance. I would need something like `extQ` (show :: Show a => a -> String ) i. e. use Show instance if available, or `extQ` ( lshow :: [ a ] -> String ) i. e. use another function if argument type is a list type BTW: I guess the above is related to http://homepages.cwi.nl/~ralf/syb3/ Do the current (6.4) ghc compiler/libraries correspond to what's in that paper? -- -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 -- ---- http://www.imn.htwk-leipzig.de/~waldmann/ -------
participants (1)
-
Johannes Waldmann