Custom Query (7510 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (46 - 48 of 7510)

Ticket Resolution Summary Owner Reporter
#10020 fixed GHC 7.10 rejects nullary type class with associated data RyanGlScott
Description

In GHC 7.8.4, the following code is legal:

{-# LANGUAGE NullaryTypeClasses, TypeFamilies #-}
module NullaryData where

class NullaryClass where
    data NullaryData

In GHC 7.10, NullaryTypeClasses was deprecated in favor of MultiParamTypeClasses. However, running this code on GHC 7.10-rc1:

{-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-}
module NullaryData where

class NullaryClass where
    data NullaryData

results in this error:

NullaryData.hs:4:1:
    The associated type ‘NullaryData’
    mentions none of the type or kind variables of the class ‘NullaryClass’
    In the class declaration for ‘NullaryClass’

It's probably related to this earlier bugfix.

#10019 fixed GHCi cannot reify a custom data constructor with Template Haskell on the first attempt RyanGlScott
Description

I've uncovered an unusual bug with Template Haskell inside of GHCi. To duplicate it, load GHCi, create a data type, then attempt to reify one of its constructors. It will fail the first time, but succeed the second time.

$ ghci -XTemplateHaskell
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ> import Language.Haskell.TH
λ> data Option a = Some a | None
λ> $(reify 'Some >>= stringE . show)
Failed to load interface for ‘Ghci1’
no package matching ‘interactive’ was found
λ> $(reify 'Some >>= stringE . show)
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
"DataConI Ghci1.Some (ForallT [PlainTV a_1627392303] [] (AppT (AppT ArrowT (VarT a_1627392303)) (AppT (ConT Ghci1.Option) (VarT a_1627392303)))) Ghci1.Option (Fixity 9 InfixL)"

Curiously, this doesn't happen when you reify a data constructor in base, such as Just:

$ ghci -XTemplateHaskell
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
λ> import Language.Haskell.TH
λ> $(reify 'Just >>= stringE . show)
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
"DataConI Data.Maybe.Just (ForallT [PlainTV a_1627398816] [] (AppT (AppT ArrowT (VarT a_1627398816)) (AppT (ConT Data.Maybe.Maybe) (VarT a_1627398816)))) Data.Maybe.Maybe (Fixity 9 InfixL)"
#10017 fixed signal handlers are invoked multiple times when the threaded rts is used AndreasVoellmy redneb
Description

When you install a custom signal handler and the threaded rts is being used, then the signal handler will be invoked multiple times. Here's a program that the demonstrates this:

import Control.Concurrent
import System.Posix.Signals

main :: IO ()
main = do
    _ <- flip (installHandler sig) Nothing $ Catch $
        putStrLn $ "Received signal " ++ show sig
    raiseSignal sig
    threadDelay 100000
  where
    sig = sigUSR2

If you compile this with the -threaded flag and then run it with say +RTS -N4 then it produces the following output:

Received signal 12
Received signal 12
Received signal 12
Received signal 12
Received signal 12

In general the signal handler is invoked n_capabilities+1 times. This also happens with all other signals.

This regression was introduced by f9f89b7884ccc8ee5047cf4fffdf2b36df6832df (which was later reverted but then re-added), a commit addressing #9423.

The cause of the problem is this loop. I don't understand why we need to write an event about the signal received in the per capability control pipe introduced by the aforementioned commit. Aren't these control pipes supposed only to be used to shutdown the capabilities (which happens here)?

Removing the loop seems to solve the issue, but I don't know if it makes #9423 reappear. I cannot test this on a Mac OS X right now.

Note: See TracQuery for help on using queries.