I have a program where UHC fails to default a numeric literal to Integer. The offending function definition is inside of an instance declaration and, weirdly, if I move the function definition to the top level it typechecks.
f :: Num a => a -> ()
f _ = ()
class C a where
it :: a
-- Here I get a type error:
-- Predicates remain unproven:
-- preds: UHC.Base.Num v_3_190_2
-- at :
-- trace: (UHC.Base.Num v_3_190_2,<4,0>,Test.hs:15:8): FAIL
-- (UHC.Base.Num v_3_190_2,<4,0>,Test.hs:15:8): FAIL
instance C () where
it = f 0
-- This one compiles fine.
it' :: ()
it' = f 0
P.S. - this bug is currently the only thing preventing QuickCheck from compiling on UHC, so it would be nice to get it fixed!
fix for issue #18, faulty defaulting inside instance decl
Bug example now compiles ok, please check if it is so in your code.
Great, thanks! QuickCheck now compiles and seems to work fine. Should work out of the box with cabal install --uhc provided you use the latest version of Cabal from git.
cabal install --uhc