<div dir="ltr"><div dir="ltr"><div>Is this problem related to the following?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>{- Note [Error and friends have an "open-tyvar" forall]<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>'error' and 'undefined' have types<br>        error     :: forall (v :: RuntimeRep) (a :: TYPE v). String -> a<br>        undefined :: forall (v :: RuntimeRep) (a :: TYPE v). a<br>Notice the runtime-representation polymorphism. This ensures that<br>"error" can be instantiated at unboxed as well as boxed types.<br>This is OK because it never returns, so the return type is irrelevant.<br><br></div></blockquote><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 10:47 PM Csaba Hruska <<a href="mailto:csaba.hruska@gmail.com">csaba.hruska@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote></div>