#9668: Unicode info is out of date
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: ekmett
Type: task | Status: new
Priority: normal | Milestone: 7.10.1
Component: Core Libraries | Version: 7.9
Keywords: Unicode | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure: Incorrect
Blocked By: | result at runtime
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
The automatically generated `WCsubst.c` was last generated in 2011. The
Unicode standard has been updated several times since then. I would like
to try to replace that whole mechanism with something a little more cache-
friendly, but at the very list the tables need to be right. Unfortunately,
the script that generates this file gives no information about its input
format, or just where a file with the right format is supposed to come
from.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9668>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#2496: Invalid Eq/Ord instances in Data.Version
-------------------------------------+-------------------------------------
Reporter: guest | Owner: duncan
Type: bug | Status: patch
Priority: normal | Milestone: ⊥
Component: Core | Version: 6.8.3
Libraries | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D395 |
-------------------------------------+-------------------------------------
Comment (by ekmett):
@hvr See the link from thomie above ~5 weeks ago.
Makes sense to me.
So is the plan then to depcate the tags now and remove them later?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2496#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#9740: D380 caused fft2 regressions
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.8.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Easy (less than 1 | Type of failure: Runtime
hour) | performance bug
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D390
-------------------------------------+-------------------------------------
When I got rid of the hand-unboxing in GHC.List, I missed the fact that a
`take` helper function took an unboxed value and was therefore strict.
When I changed that to a regular function, I didn't make it strict, and
this caused a regression in fft2 and (I believe) also a test suite perf
test. The function is properly strictified in D390.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9740>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#9719: Improve `mkInteger` interface
-------------------------------------+-------------------------------------
Reporter: hvr | Owner:
Type: task | Status: new
Priority: low | Milestone: 7.12.1
Component: Compiler | Version:
Keywords: Integer | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
`mkInteger` is the current operation provided by the `Integer` libraries
to construct (large) integer values. The current type-signature is
{{{#!hs
mkInteger :: Bool -- sign-bit
-> [Int] -- absolute value in 31 bit chunks, least significant
first
-> Integer
}}}
A somewhat pathological example of why this representation is not so nice
is the following simple CAF
{{{#!hs
c :: Integer
c = 0xf000000000000000
}}}
that (this is for a 64bit arch!) gets compiled into the following STG:
{{{
==================== STG syntax: ====================
sat_sJQ :: GHC.Types.Int
[LclId, Str=DmdType] =
NO_CCS GHC.Types.I#! [3];
sat_sJR :: [GHC.Types.Int]
[LclId, Str=DmdType] =
NO_CCS :! [sat_sJQ GHC.Types.[]];
sat_sJP :: GHC.Types.Int
[LclId, Str=DmdType] =
NO_CCS GHC.Types.I#! [1610612736];
sat_sJS :: [GHC.Types.Int]
[LclId, Str=DmdType] =
NO_CCS :! [sat_sJP sat_sJR];
sat_sJO :: GHC.Types.Int
[LclId, Str=DmdType] =
NO_CCS GHC.Types.I#! [0];
sat_sJT :: [GHC.Types.Int]
[LclId, Str=DmdType] =
NO_CCS :! [sat_sJO sat_sJS];
Foo.c :: GHC.Integer.Type.Integer
[GblId, Str=DmdType] =
\u srt:SRT:[0Y :-> GHC.Integer.Type.mkInteger, sJT :-> sat_sJT] []
GHC.Integer.Type.mkInteger GHC.Types.True sat_sJT;
}}}
Instead a more "natural" `mkInteger` would be desirable, possibly in the
style of `unpackCString#`, in terms of a packed/unboxed vector of machine-
word-sized chunks. A better `mkInteger` could then take a `ByteArray#` or
a `Addr#` + length instead, e.g.
{{{#!hs
mkInteger :: Int# -- signum(n) = sign of encoded Integer
-- abs(n) = number of machine-word sized chunks
-> Addr# -- pointer to start of machine-word sized chunks,
-- least-significant chunk first
-> Integer
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9719>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#9716: The list modules need a bit of post-BBP shaking
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: ekmett
Type: task | Status: new
Priority: normal | Milestone: 7.10.1
Component: Core Libraries | Version: 7.8.3
Keywords: lists | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
We currently have an unfortunately named `Data.List.OldList`, and no
terribly clear story to explain it. One concept, due in part to me and in
part to Carter:
1. Move all the basics needed to implement `instance Foldable []` from
`Data.OldList` to `Data.List.Base` (or some similar name).
2. Move all the "extras" like `inits`, `tails`, and `sort` from
`Data.OldList` into `Data.List`.
3. Delete `Data.OldList`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9716>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#9510: Prelude.!! is not a good consumer
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 7.8.3
Keywords: fusion | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure: Runtime
Blocked By: | performance bug
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
I think we can probably do something like this, but I haven't checked the
Core yet:
{{{#!hs
xs !! n
| n < 0 = error "Prelude.!!: Negative index"
| otherwise = foldr go (error "Prelude.!!: index too large or list
empty") xs n
where
go x _ 0 = x
go _ f k = f (k - 1)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9510>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
#9733: Strange errors when using type families as parameters
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure: GHC
Blocked By: | rejects valid program
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
I seem to have found a dark corner of GHC. In the process of finding a
minimal example, I found a few different ways to trigger a bug. I'm
assuming they are all related.
== Example 1 ==
I started off with a GADT parameterized by a type list:
{{{#!haskell
{-# LANGUAGE TypeFamilies, GADTs, DataKinds, TypeOperators #-}
module Foo where
type TList = '[Float, Double]
type family PrevElt (xs :: [*]) (a :: *) :: * where
PrevElt (b ': a ': xs) a = b
PrevElt (b ': c ': xs) a = PrevElt (c ': xs) a
data FooList :: ([*] -> * -> *) where
Bar :: FooList prevrp ((PrevElt prevrp rp) -> rp)
test1 :: FooList TList ((PrevElt TList rp) -> rp)
test1 = Bar
}}}
which compiles as expected.
If I make a syntactic change and parameterize the GADT with the type
family rather than the type list:
{{{#!hs
{-# LANGUAGE TypeFamilies, GADTs, DataKinds, TypeOperators #-}
module Foo where
type TList = '[Float, Double]
type family PrevElt (xs :: [*]) (a :: *) :: * where
PrevElt (b ': a ': xs) a = b
PrevElt (b ': c ': xs) a = PrevElt (c ': xs) a
data FooTF :: ((* -> *) -> * -> *) where
Bar :: FooTF prevrp ((prevrp rp) -> rp)
test2 :: FooTF (PrevElt TList) ((PrevElt TList rp) -> rp)
test2 = Bar
}}}
I get a non-sensical error:
{{{
Foo.hs:15:9:
Couldn't match type `PrevElt TList rp' with `PrevElt TList rp'
NB: `PrevElt' is a type function, and may not be injective
Expected type: FooTF (PrevElt TList) (PrevElt TList rp -> rp)
Actual type: FooTF (PrevElt TList) (PrevElt TList rp -> rp)
Relevant bindings include
test2 :: FooTF (PrevElt TList) (PrevElt TList rp -> rp)
(bound at testsuite\Foo.hs:15:1)
In the expression: Bar
In an equation for `test2': test2 = Bar
}}}
As far as I know, this should compile.
== Example 2 ==
Another simple example uses [https://hackage.haskell.org/package/syntactic
syntactic], along with the type-family-parameterized GADT:
{{{#!hs
{-# LANGUAGE TypeFamilies, GADTs, DataKinds, TypeOperators #-}
module Foo where
import Data.Syntactic
type family PrevElt (xs :: [*]) (a :: *) :: * where
PrevElt (b ': a ': xs) a = b
PrevElt (b ': c ': xs) a = PrevElt (c ': xs) a
data FooTF :: ((* -> *) -> * -> *) where
Const :: FooTF prevrp (Full rp)
Bar :: FooTF prevrp ((prevrp rp) :-> Full rp)
type T1 = Double
type T2 = Float
type Dom = FooTF (PrevElt '[T1, T2])
leaf = inj (Const :: Dom (Full T1)) :: ASTF Dom T1
t1 = inj (Bar :: Dom (T1 :-> Full T2)) :$ leaf :: ASTF Dom T2
}}}
By only changing the types `T1` and `T2`:
{{{#!hs
{-# LANGUAGE TypeFamilies, GADTs, DataKinds, TypeOperators #-}
module Foo where
import Data.Syntactic
type family PrevElt (xs :: [*]) (a :: *) :: * where
PrevElt (b ': a ': xs) a = b
PrevElt (b ': c ': xs) a = PrevElt (c ': xs) a
data FooTF :: ((* -> *) -> * -> *) where
Const :: FooTF prevrp (Full rp)
Bar :: FooTF prevrp ((prevrp rp) :-> Full rp)
data T
type T1 = T Double
type T2 = T Float
type Dom = FooTF (PrevElt '[T1, T2])
leaf = inj (Const :: Dom (Full T1)) :: ASTF Dom T1
t1 = inj (Bar :: Dom (T1 :-> Full T2)) :$ leaf :: ASTF Dom T2
}}}
GHC complains:
{{{
Foo.hs:21:11:
Couldn't match type ‘Double’ with ‘T Float’
Expected type: Dom (T1 :-> Full T2)
Actual type: FooTF T (T Double :-> Full Double)
In the first argument of ‘inj’, namely
‘(Bar :: Dom (T1 :-> Full T2))’
In the first argument of ‘(:$)’, namely
‘inj (Bar :: Dom (T1 :-> Full T2))’
Failed, modules loaded: none.
}}}
== Example 3 ==
I've also attached a larger example (also using
[https://hackage.haskell.org/package/syntactic syntactic]) that has [more,
different] errors, which I believe to be related to this problem. Errors
for the attached file are:
{{{
Foo.hs:32:6:
Couldn't match type `NextElt TList (PrevElt ((':) * (T' Float) ('[]
*)) Double)'
with `Double'
Expected type: Double
Actual type: NextElt TList (PrevElt TList Double)
In the first argument of `(:$)', namely `inj' Bar'
In the expression: inj' Bar :$ leaf
In an equation for `t1': t1 = inj' Bar :$ leaf
Foo.hs:32:11:
Couldn't match type `PrevElt TList' with T'
Expected type: Dom (Foo (T' Double) T1 :-> Full (Foo Double T1))
Actual type: FooTF
T' (Foo (T' Double) T1 :-> Full (Foo Double T1))
In the first argument of inj', namely `Bar'
In the first argument of `(:$)', namely `inj' Bar'
}}}
In the first error, the `Actual type: NextElt TList (PrevElt TList
Double)` is strange because `Double` only occurs as a parameter to `T'`,
and never as a naked type that could be applied to type family.
In the second error, GHC seems to be confusing two types of kind `(* ->
*)`: `T'` and `PrevElt TList`.
Changing the GADT from type-family-indexed to type-list-index (like in the
first example) makes the attached code compile. I minimized the attached
example as much as possible: any changes I made to simplify the code
resulted in different errors, which may also be helpful for finding this
bug.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9733>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler