Custom Query (7507 matches)


Show under each result:

Results (25 - 27 of 7507)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#9560 duplicate "Illegal equational constraint" that might not be the users fault rrnewton

If you try the latest cabal head and GHC together as of 2014.09.04, and then you try to install statistics, you'll see an error like the following, which does not occur in GHC 7.8.3:

cabal-1.21 install -w ghc-7.9.20140904
Resolving dependencies...
Configuring statistics-
Building statistics-
Preprocessing library statistics-
[ 1 of 46] Compiling Statistics.Test.Internal ( Statistics/Test/Internal.hs, dist/build/Statistics/Test/Internal.o )
[ 2 of 46] Compiling Statistics.Test.Types ( Statistics/Test/Types.hs, dist/build/Statistics/Test/Types.o )
[ 3 of 46] Compiling Statistics.Internal ( Statistics/Internal.hs, dist/build/Statistics/Internal.o )
[ 4 of 46] Compiling Statistics.Transform ( Statistics/Transform.hs, dist/build/Statistics/Transform.o )

    Illegal equational constraint Control.Monad.Primitive.PrimState m
                                  ~ s
    (Use GADTs or TypeFamilies to permit this)
    When checking that ‘bitReverse’ has the inferred type
      bitReverse :: forall (m :: * -> *) b.
                    (Control.Monad.Primitive.PrimMonad m,
                     Control.Monad.Primitive.PrimState m ~ s) =>
                    Int -> Int -> m b
    In an equation for ‘mfft’:

(Indeed, adding the GADTs language pragma makes the type checker happy, as in the commit here: )

Hmm, well, the source code in this case did not explicitly add the "~ s" constraint, the inference cooked it up. Is this a GHC bug in 7.9 or in 7.8?

#3485 invalid "Illegal type synonym family application in instance" error is unnecessary, should be removed Ashley Yakeley

GHC shouldn't complain about "Illegal type synonym family application in instance", since there's an obvious workaround:

type family Fam t
instance C (Fam Int)

can become

type family Fam t
instance (Fam Int ~ famint) => C famint

The programmer ought to be smart enough to notice that Fam is not a type-constructor, so "Fam Int" is going to overlap like a type-variable.

#8044 fixed "Inaccessible code" error reported in wrong place goldfire

Here is my file Bug.hs:

{-# LANGUAGE GADTs, TypeFamilies #-}

module Bug where

data X a where
  XInt :: X Int
  XBool :: X Bool
  XChar :: X Char

type family Frob a where
  Frob Int = Int
  Frob x   = Char

frob :: X a -> X (Frob a)
frob XInt = XInt
frob _    = XChar

Compiling this file produces the error

    Couldn't match type ‛Int’ with ‛Char’
    Inaccessible code in
      a pattern with constructor XInt :: X Int, in an equation for ‛frob’
    In the pattern: XInt
    In an equation for ‛frob’: frob XInt = XInt

The line/column number single out the pattern XInt in the first clause of the function frob. But, the real problem (as I see it), is the right-hand side of the second clause of frob. Indeed, when I comment out the second line of the function, the error goes away, even though it was reported on the first line.

I do not believe that this error is caused by closed type families, per se, because I have run across it without them, just in code that was too hard to pare down enough to make a bug report out of.

This was tested on 7.7.20130702.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.