|
[ ghc-Bugs-1146068 ] Data.Generics type error: msg#00088lang.haskell.glasgow.bugs
Bugs item #1146068, was opened at 2005-02-22 09:11 Message generated for change (Comment added) made by simonpj You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1146068&group_id=8032 Category: Compiler (Type checker) Group: 6.4 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Data.Generics type error Initial Comment: I get a strange type error when using Data.Generics.Twins - but if I include the text of the definition in my own file it works! I attach two files, one type checks, one does not. The only difference is that I move a definition between modules. /Patrik ---------------------------------------------------------------------- >Comment By: Simon Peyton Jones (simonpj) Date: 2005-02-28 17:24 Message: Logged In: YES user_id=50165 Fixed, thank you. Type synonyms in interface files weren't being "hoisted". tc191.hs is the regression test ---------------------------------------------------------------------- Comment By: Patrik Jansson (p1738j) Date: 2005-02-22 12:10 Message: Logged In: YES user_id=1151788 Background: I tried to use Nils Ander Danielssons "ChasingBottoms" package for doing some "bottom-debugging" of code. In 6.2.2 it works fine, but when "upgrading" to a 6.4 release candidate I had to do this strange copying ---------------------------------------------------------------------- Comment By: Patrik Jansson (p1738j) Date: 2005-02-22 09:18 Message: Logged In: YES user_id=1151788 The error is the following: Compiling Main ( testeq_bad.hs, interpreted ) testeq_bad.hs:21:34: Inferred type is less polymorphic than expected Quantified type variable `a' escapes Expected type: a1 -> GenericQ Bool Inferred type: a1 -> a -> Bool In the first argument of `gzipWithQ', namely `geq'' In the first argument of `and', namely `(gzipWithQ geq' x y)' Failed, modules loaded: none. ---------------------------------------------------------------------- Comment By: Patrik Jansson (p1738j) Date: 2005-02-22 09:16 Message: Logged In: YES user_id=1151788 -- I did not manage to later add the second file - here it is instead: -- I tested this with ghci-6.4.20050214 ----- {-# OPTIONS -fglasgow-exts #-} import Data.Generics.Basics import Data.Generics.Aliases import Data.Generics.Twins(gmapAccumQ) -- | Twin map for queries gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r]) gzipWithQ f x y = case gmapAccumQ perkid funs y of ([], r) -> r _ -> error "gzipWithQ" where perkid a d = (tail a, unGQ (head a) d) funs = gmapQ (\k -> GQ (f k)) x -- | Generic equality: an alternative to \deriving Eq\ geq :: Data a => a -> a -> Bool geq x y = geq' x y where geq' :: forall a b. (Data a, Data b) => a -> b -> Bool geq' x y = (toConstr x == toConstr y) && and (gzipWithQ geq' x y) ---------------------------------------------------------------------- Comment By: Patrik Jansson (p1738j) Date: 2005-02-22 09:13 Message: Logged In: YES user_id=1151788 This was submitted by me (Patrik Jansson = p1738j at sf.net) - I just loggon on too late. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1146068&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: configure problems, Simon Marlow |
|---|---|
| Next by Date: | [ ghc-Bugs-1153674 ] option -cpp and having C comments gives wrong linenumbers, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-1146068 ] Data.Generics type error, SourceForge.net |
| Next by Thread: | [ ghc-Bugs-1146118 ] gmp's memory management, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |