<div dir="ltr"><div><div><div>Hi,</div><div><br></div><div>I'd like to export the PrimRep of every binder and data con from Haskell modules.</div><br></div><div>I have a modified GHC 8.6 which serializes the PrimRep for every binder during the compilation. It uses the <b>typePrimRep</b> function. When my customised GHC compiles the base library it always thows the following error for the <a href="https://github.com/grin-tech/ghc-grin/blob/master/ghc-8.6.2/libraries/base/GHC/Err.hs"><b>libraries/base/GHC/Err.hs</b> </a>module.</div><ol><li>Does that mean that there is hidden requirement for typePrimRep input?</li><li>If so what are the restrictions?</li><li>Can you see anything in the Err module source code that could not be a proper input for typePrimRep function?</li></ol><div><br></div><div>Thanks,</div><div>Csaba<br></div><div><br></div><div><span style="font-family:monospace,monospace">"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -Wall      -this-unit-id base-4.12.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -Ilibraries/base/dist-install/build -ilibraries/base/dist-install/build/./autogen -Ilibraries/base/dist-install/build/./autogen -Ilibraries/base/include -Ilibraries/base/dist-install/build/include   -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist-install/build/./autogen/cabal_macros.h -package-id ghc-prim-0.5.3 -package-id integer-gmp-1.0.2.0 -package-id rts -this-unit-id base -Wcompat -Wnoncanonical-monad-instances -XHaskell2010 -O2 -haddock  -no-user-package-db -rtsopts  -Wno-trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir libraries/base/dist-install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build  -split-sections -dynamic-too -c libraries/base/./GHC/Err.hs -o libraries/base/dist-install/build/GHC/Err.o -dyno libraries/base/dist-install/build/GHC/Err.dyn_o</span><br><span style="font-family:monospace,monospace">ghc-stage1: panic! (the 'impossible' happened)</span><br><span style="font-family:monospace,monospace">  (GHC version 8.6.2 for x86_64-unknown-linux):</span><br><span style="font-family:monospace,monospace">    runtimeRepPrimRep</span><br><span style="font-family:monospace,monospace">  typePrimRep (a_a1ML :: TYPE r_a1MK)</span><br><span style="font-family:monospace,monospace">  r_a1MK</span><br><span style="font-family:monospace,monospace">  Call stack:</span><br><span style="font-family:monospace,monospace">      CallStack (from HasCallStack):</span><br><span style="font-family:monospace,monospace">        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable</span><br><span style="font-family:monospace,monospace">        pprPanic, called at compiler/simplStg/RepType.hs:358:5 in ghc:RepType</span><br><span style="font-family:monospace,monospace"></span><br><span style="font-family:monospace,monospace">Please report this as a GHC bug:  <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a></span><br><span style="font-family:monospace,monospace"></span><br><span style="font-family:monospace,monospace">libraries/base/<a href="http://ghc.mk:4">ghc.mk:4</a>: recipe for target 'libraries/base/dist-install/build/GHC/Err.o' failed</span><br><span style="font-family:monospace,monospace">make[1]: *** [libraries/base/dist-install/build/GHC/Err.o] Error 1</span><br><span style="font-family:monospace,monospace">Makefile:122: recipe for target 'all' failed</span><br><span style="font-family:monospace,monospace">make: *** [all] Error 2</span><br></div><div><span style="font-family:monospace,monospace"></span><div style="margin-left:40px"><br></div></div></div></div>