Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

build error (GHC 6.12.3) #4

Closed
kowey opened this issue Sep 9, 2011 · 5 comments
Closed

build error (GHC 6.12.3) #4

kowey opened this issue Sep 9, 2011 · 5 comments

Comments

@kowey
Copy link
Contributor

kowey commented Sep 9, 2011

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-59

Data/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 dependency `a -> 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) for `parseList'
    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 1
@kowey
Copy link
Contributor Author

kowey commented Sep 9, 2011

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...

@kowey kowey closed this as completed Sep 9, 2011
@kowey kowey reopened this Sep 9, 2011
@nominolo
Copy link
Owner

nominolo commented Sep 9, 2011

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 typeb'
         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-59

   Data/AttoLisp.hs:309:2:
       Couldn't match expected type c' against inferred typeb'
         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 dependency a -> b'            in the instance declaration at Data/AttoLisp.hs:314:9          ParseList b c,            arising from a use ofparseList' at Data/AttoLisp.hs:312:4-25
       When generalising the type(s) for parseList'        In the instance declaration forParseList (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 ofb'
        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 1

Reply to this email directly or view it on GitHub:
#4

Push the envelope. Watch it bend.

@kowey
Copy link
Contributor Author

kowey commented Sep 9, 2011

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 :-)

@nominolo
Copy link
Owner

nominolo commented Sep 9, 2011

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.

@nominolo nominolo closed this as completed Sep 9, 2011
@nominolo nominolo reopened this Sep 9, 2011
@nominolo
Copy link
Owner

Closing, because 6.12 is no longer supported.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants