Closed kowey closed 8 years ago
What's also odd about this is that I could have sworn I was using GHC 6.12.x on a Windows VM to build atto-lisp too. So I don't know what it should fail for my user...
I don't think so.
The problem is with the 'struct' function and its use of the ParseList type class.
The idea is to have the user provide a function (actually a constructor) and from that we can automatically figure out the parser. I'm not sure if this is even supposed to work, but it seems to work fine with GHC 7+. I'll take a look.
On 9 September 2011 11:51, kowey reply@reply.github.com wrote:
Hi Thomas,
One of my users reports the following build error with GHC 6.12.3. Do you think it's an easy fix? Thanks! :-)
Data/AttoLisp.hs:1:0: Couldn't match expected type
c' against inferred type
b'c' is a rigid type variable bound by the instance declaration at Data/AttoLisp.hs:308:34
b' is a rigid type variable bound by the instance declaration at Data/AttoLisp.hs:308:32 When using functional dependencies to combine ParseList b b, arising from a use of `parseList' at Data/AttoLisp.hs:312:4-25 ParseList b c, arising from the instance declaration at Data/AttoLisp.hs:308:9-59Data/AttoLisp.hs:309:2: Couldn't match expected type
c' against inferred type
b'c' is a rigid type variable bound by the instance declaration at Data/AttoLisp.hs:308:34
b' is a rigid type variable bound by the instance declaration at Data/AttoLisp.hs:308:32 When using functional dependencies to combine ParseList a a, arising from the dependencya -> b' in the instance declaration at Data/AttoLisp.hs:314:9 ParseList b c, arising from a use of
parseList' at Data/AttoLisp.hs:312:4-25 When generalising the type(s) forparseList' In the instance declaration for
ParseList (a -> b) c'Data/AttoLisp.hs:312:4: Overlapping instances for ParseList b b arising from a use of
parseList' at Data/AttoLisp.hs:312:4-25 Matching instances: instance ParseList a a -- Defined at Data/AttoLisp.hs:314:9-21 instance (FromLisp a, ParseList b c) => ParseList (a -> b) c -- Defined at Data/AttoLisp.hs:308:9-59 (The choice depends on the instantiation of
b' To pick the first instance above, use -XIncoherentInstances when compiling the other instance declarations) In the expression: parseList msg (f y) xs In the expression: do { y <- parseLisp x; parseList msg (f y) xs } In the definition of `parseList': parseList msg f (x : xs) = do { y <- parseLisp x; parseList msg (f y) xs } cabal: Error: some packages failed to install: atto-lisp-0.2 failed during the building phase. The exception was: ExitFailure 1Reply to this email directly or view it on GitHub: https://github.com/nominolo/atto-lisp/issues/4
Push the envelope. Watch it bend.
OK, just to make sure there's no needless sense of urgency, my user just told me they upgraded to GHC 7, so problem solved for my purposes :-)
OK. I still want to make sure that the current implementation doesn't just work by accident. I'll ask haskell-cafe and see if Oleg chimes in.
Closing, because 6.12 is no longer supported.
Hi Thomas,
One of my users reports the following build error with GHC 6.12.3. Do you think it's an easy fix? Thanks! :-)