[commit: hsc2hs] master: Make --cross-compile handle negative enum values. (10696fe)

git at git.haskell.org git at git.haskell.org
Thu Oct 30 04:03:40 UTC 2014


Repository : ssh://git@git.haskell.org/hsc2hs

On branch  : master
Link       : http://git.haskell.org/hsc2hs.git/commitdiff/10696fe17c9d2b4e3498684c6ffbd9f44eda53c4

>---------------------------------------------------------------

commit 10696fe17c9d2b4e3498684c6ffbd9f44eda53c4
Author: Stephen Paul Weber <singpolyma at singpolyma.net>
Date:   Wed Oct 29 23:02:50 2014 -0500

    Make --cross-compile handle negative enum values.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

10696fe17c9d2b4e3498684c6ffbd9f44eda53c4
 CrossCodegen.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CrossCodegen.hs b/CrossCodegen.hs
index 687f5be..bb275ff 100644
--- a/CrossCodegen.hs
+++ b/CrossCodegen.hs
@@ -452,7 +452,7 @@ computeEnum z@(ZCursor (Special _ _ enumText) _ _) =
                 let hsName = fromMaybe (haskellize cName) maybeHsName
                 return $
                     hsName ++ " :: " ++ stringify enumType ++ "\n" ++
-                    hsName ++ " = " ++ stringify constructor ++ " " ++ show constValue ++ "\n"
+                    hsName ++ " = " ++ stringify constructor ++ " " ++ showsPrec 11 constValue "\n"
     where concatM l = liftM concat . forM l
 computeEnum _ = error "computeEnum argument isn't a Special"
 



More information about the ghc-commits mailing list