Skip to content

ghc: panic! (the 'impossible' happened)

ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.2 for x86_64-unknown-linux):
	initTc: unsolved constraints
  WC {wc_insol =
        [W] ask_an9K :: t_an9J[tau:1] (CHoleCan: ask)
        [W] put_an9Q :: t_an9P[tau:1] (CHoleCan: put)}

So this code derives an instance of the Decimal type incorrectly, but not sure if this is causing the error.

I have some nested records, which contain a few Decimals. I am trying to make them acidic.

instance SafeCopy (DecimalRaw a) where
  putCopy (Decimal d) = contain $ safePut d
  getCopy = contain $ Decimal <$> safeGet

deriveSafeCopy 0 'base ''Client
deriveSafeCopy 0 'base ''Article


deriveSafeCopy 0 'base ''ServerData
makeLenses ''ServerData

writeState :: String -> Update ServerData ()
writeState newValue
  = put (ServerData newValue)
queryState :: Update ServerData String
queryState = do ServerData string <- ask
                return string

makeAcidic ''ServerData ['writeState 'queryState]
Trac metadata
Trac field Value
Version 8.0.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information