Custom Query (6603 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (13 - 15 of 6603)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ticket Resolution Summary Owner Reporter
#4246 fixed "Conflicting family instance declarations" error mentions code I did not write TillmannRendel
Description

I get an error message mentioning code that I did not write but results from desugaring when compiling the following program:

{-# LANGUAGE TypeFamilies, FlexibleInstances, OverlappingInstances #-}

class Stupid a where
  type F a

instance Stupid a where
  type F a = a

instance Stupid Int where
  type F Int = Bool

The error I get is:

families.hs:7:7:
    Conflicting family instance declarations:
      type instance F a -- Defined at families.hs:7:7
      type instance F Int -- Defined at families.hs:10:7

The error mentions "type instance F a", but it should say "type F a", because that is what I wrote in the source file. Or maybe "type F a in instance Stupid a" to make it clear that it's an instance declaration.

#6020 fixed "Couldn't match kind" with free type variables and PolyKinds atnnn
Description

In the following code, I was hoping that GHC could infer the more specific kind of the free variable y and the class Id in the head of the instance for Test.

Also, the error message is confusing:

  • It says that 'True has kind k0 (maybe it's an impredicative kind?)
  • It refers to k0 as a type variable
{-# LANGUAGE DataKinds, FunctionalDependencies, FlexibleInstances,
             UndecidableInstances, PolyKinds, KindSignatures,
             ConstraintKinds, FlexibleContexts #-}

import GHC.Prim (Constraint)

class Id (a :: k) (b :: k) | a -> b
instance Id a a

class Test (x :: a) (y :: a) | x -> y
instance (Id x y, Id y z) => Test x z

test :: Test True True => ()
test = ()
>>> test
<interactive>:54:1:
    Couldn't match kind `k0' with `Bool'
      `k0' is an unknown type variable
    Kind incompatibility when matching types:
      'True :: k0
      'True :: Bool
    When using functional dependencies to combine
      Id k0 a a,
        arising from the dependency `a -> b'
        in the instance declaration at /home/atnnn/code/type-prelude/testfoldl.hs:8:10
      Id Bool 'True 'True,
        arising from a use of `test' at <interactive>:54:1-4
    In the expression: test
#3908 wontfix "Defined but not used" for variable used in Template Haskell splice josh
Description

I encountered this warning on valid code using Template Haskell ; I had to change "name" to "_name" to make it compile warning-free.

Test case:

{-# LANGUAGE FlexibleInstances, TemplateHaskell #-}
import Language.Haskell.TH

main :: IO ()
main = do
    let name = mkName "name"
    decl <- runQ [d| instance Show $(conT name) where show = undefined |]
    print decl

Warnings:

TestCase.hs:6:8: Warning: Defined but not used: `name'

I found ticket #3873, but I don't know if it represents the same bug.

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