>>> :i Int data Int = I# E.Int# -- Defined in ‘GHC.Types’}}}",Iceland_jack 13742,Code using ConstraintKinds needs explicit kind signature with GHC 8.2.1,Compiler (Type checker),8.2.1-rc2,,bug,,new,2017-05-22T16:21:16Z,2017-05-23T22:09:05Z,"The attached module compiles without errors with GHC 8.0.1 but needs an explicit kind signature with GHC 8.2.1-rc2. Mentioned in this [https://mail.haskell.org/pipermail/ghc-devs/2017-May/014222.html ghc-dev thread]. Compiling the attached file fails gives the error: {{{ [[1 of 1] Compiling CKBug ( CKBug.hs, interpreted ) CKBug.hs:33:4: error: • Expected a type, but ‘(PropagIOConstraint l a, Missing (PropagIOVector l) (PropagIONullable l a), Elem (PropagIONullable l a) ~ a)’ has kind ‘Constraint’ • In the type ‘((PropagIOConstraint l a, Missing (PropagIOVector l) (PropagIONullable l a), Elem (PropagIONullable l a) ~ a))’ In the type declaration for ‘CanSerialize’ | 33 | (( PropagIOConstraint l a | ^^^^^^^^^^^^^^^^^^^^^^^^... CKBug.hs:42:4: error: • Expected a constraint, but ‘(CanSerialize l Double, CanSerialize l Int)’ has kind ‘*’ • In the type ‘(CanSerialize l Double, CanSerialize l Int)’ In the type declaration for ‘CanSerializePropagTypes’ | 42 | ( CanSerialize l Double | ^^^^^^^^^^^^^^^^^^^^^^^... }}}",albertov 13739,Very slow linking of profiled executables,Compiler,8.2.1-rc2,,bug,,new,2017-05-22T03:06:41Z,2017-05-27T21:22:27Z,"While building profiled executables with 8.2.1rc2 I've noticed the link times seem to have significantly regressed. I don't have a minimal test case. Testing on cabal head source tree {{{ cabal --version >cabal-install version 2.1.0.0 >compiled using version 2.1.0.0 of the Cabal library cabal new-configure --enable-profiling --enable-newer --with-ghc=/opt/ghc-8.2.1/bin/ghc cabal build cabal-install # hit Ctrl-C during linking time cabal build cabal-install }}} gives real 1m54.833s user 1m52.936s sys 0m1.620s doing the same with 8.0.2 links in less than a second ",duog 13738,TypeApplications-related GHC internal error,Compiler,8.0.1,,bug,,new,2017-05-22T01:09:31Z,2017-05-25T23:18:55Z,"This is reproducible with GHC 8.0.1, 8.0.2, 8.2.1, and HEAD: {{{#!hs {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} module Bug where import Data.Coerce class MFunctor t where hoist :: (Monad m) => (forall a . m a -> n a) -> t m b -> t n b newtype TaggedTrans tag trans m a = TaggedTrans (trans m a) instance MFunctor trans => MFunctor (TaggedTrans tag trans) where hoist = coerce @(forall (m :: * -> *) (n :: * -> *) (b :: k). Monad m => (forall (a :: *). m a -> n a) -> trans m b -> trans n b) @(forall (m :: * -> *) (n :: * -> *) (b :: k). Monad m => (forall (a :: *). m a -> n a) -> TaggedTrans tag trans m b -> TaggedTrans tag trans n b) hoist }}} {{{ GHCi, version 8.3.20170516: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:18:26: error: • GHC internal error: ‘k’ is not in scope during type checking, but it passed the renamer tcl_env of environment: [a1tR :-> Type variable ‘m’ = m, a1tS :-> Type variable ‘n’ = n, a1tT :-> Type variable ‘b’ = b, a1tV :-> Type variable ‘trans’ = trans, a1tW :-> Type variable ‘tag’ = tag, a1tX :-> Type variable ‘m’ = m, a1tY :-> Type variable ‘n’ = n, a1KE :-> Type variable ‘k’ = k, a1KF :-> Type variable ‘k’ = k] • In the kind ‘k’ In the type ‘(forall (m :: * -> *) (n :: * -> *) (b :: k). Monad m => (forall (a :: *). m a -> n a) -> trans m b -> trans n b)’ In the expression: coerce @(forall (m :: * -> *) (n :: * -> *) (b :: k). Monad m => (forall (a :: *). m a -> n a) -> trans m b -> trans n b) @(forall (m :: * -> *) (n :: * -> *) (b :: k). Monad m => (forall (a :: *). m a -> n a) -> TaggedTrans tag trans m b -> TaggedTrans tag trans n b) hoist | 18 | (b :: k). | ^ }}}",RyanGlScott 13737,Have typechecking produce HsType Typechecked instead of Type,Compiler,8.0.1,,task,,new,2017-05-22T00:53:51Z,2017-05-22T00:53:51Z,"Right now, there is an unfortunate lack of parallelism between expressions and types. When an expression is typechecked, it is transformed from `HsExpr Name` to `HsExpr TcId`. When a type is typechecked, it is transformed from `HsType Name` to `Type`. This arrangement has served us well enough for some time, but it has several drawbacks: - Validity checking is really meant to be done over user-written syntax. This bit when implementing #11715, when validity checking couldn't tell the difference between `Int => Int` (bad) and `Int -> Int` (good). There may be other opportunities for simplification by having the user-written syntax available. - The situation above extends to type-level declarations. That is, an `HsDecl Name` for a datatype goes straight to a `TyCon`, instead of to a typechecked form of source. This is problematic because it means that all of typechecking must happen ''twice''. The first is to figure out the kind of the `TyCon` (the is the `kc` pass); the actual result is discarded. Then, typechecking is repeated with the known `TyCon` kind; this pass should always succeed and is more like desugaring than typechecking. But all the constraint generation and solving happens again. - This second pass uses knot-tied `TyCon`s, leading to `Note [Type-checking inside the knot]` in !TsHsType. If we have a form of types in `HsSyn` that occurs ''after'' typechecking, we can fix the above problems, leading both to a runtime improvement (no double-checking type declarations) and code simplification (no more typechecking in the knot). This is a significant refactor, and it should proceed in at least two stages: one for just plain types, and one for type declarations. Note that we can't produce `HsType TcTyVar`, because `Name`s in `HsType Name` sometimes become `TyCon`s and sometimes become `TcTyVar`s. We really need `HsType (TyCon + TcTyVar)` or some such. But perhaps it would be better to wait until after refactoring with respect to the Trees That Grow paper.",goldfire 13733,Simplify constraints on RULES LHS,Compiler,8.3,,feature request,,new,2017-05-20T18:00:52Z,2017-05-22T22:16:45Z,"TL;DR: Rewrite rules should be able to match instance methods. I know that the interaction of rewrite rules and classes/instances/methods is unsatisfying, and probably will be for the forseeable future given the current design. But we might still improve little bits. Consider this code: {{{ {-# RULES ""[Integer] Eq Refl"" forall (xs :: [Integer]). xs == xs = True #-} }}} This is the best I can to express the intention of “dear compile, this is a rule for the equality on lists if the elements are integers”. But what I get is {{{ ""[Integer] Eq Refl"" [ALWAYS] forall ($dEq_a1Jv :: Eq [Integer]) (xs_a1Hd :: [Integer]). == @ [Integer] $dEq_a1Jv xs_a1Hd xs_a1Hd = GHC.Types.True }}} which is a rule about the method `==` applied to ''any'' evidence of equality about lists. This works in the most obvious cases, such as {{{ alwaysTrue :: [Integer]-> Bool alwaysTrue xs = xs == xs }}} but it does not fire with {{{ delayedId :: a -> a delayedId x = x {-# INLINE [0] delayedId #-} alwaysTrue :: [Integer]-> Bool alwaysTrue xs = xs == delayedId xs {-# NOINLINE alwaysTrue #-} }}} The reason is that directly after the simplifier, in the former case, the Core looks like this {{{ $dEq_a1HH :: Eq [Integer] [LclId, Str=DmdType] $dEq_a1HH = GHC.Classes.$fEq[] @ Integer integer-gmp-1.0.0.1:GHC.Integer.Type.$fEqInteger alwaysTrue [InlPrag=NOINLINE] :: [Integer] -> Bool [LclIdX, Str=DmdType] alwaysTrue = \ (xs_aGT :: [Integer]) -> == @ [Integer] $dEq_a1HH xs_aGT xs_aGT }}} which matches the rule, but in the latter case, by the time the `delayedId` is out of the way, we have {{{ alwaysTrue [InlPrag=NOINLINE] :: [Integer] -> Bool [LclIdX, Arity=1, Str=DmdType

instance Eq Int -- Defined in ‘GHC.Classes’ instance Ord Int -- Defined in ‘GHC.Classes’ instance Show Int -- Defined in ‘GHC.Show’ instance Read Int -- Defined in ‘GHC.Read’ instance Enum Int -- Defined in ‘GHC.Enum’ instance Num Int -- Defined in ‘GHC.Num’ instance Real Int -- Defined in ‘GHC.Real’ instance [safe] NFData Int -- Defined in ‘Control.DeepSeq’ instance Data Int -- Defined in ‘Data.Data’ instance Bounded Int -- Defined in ‘GHC.Enum’ instance O.Outputable Int -- Defined in ‘Outputable’ instance [safe] PrintfArg Int -- Defined in ‘Text.Printf’ instance Integral Int -- Defined in ‘GHC.Real’