Ghc mess at compile time

GHC 7.0.3 (ubuntu repoes) generates type warnings at compile time

SpecConstr Function `$j_se6a{v} [lid]' has one call pattern, but the limit is 0 Use -fspec-constr-count=n to set the bound Use -dppr-debug to see specialisations 

I created my own data type when I make it strict, there are these warnings when it is lazy, no. Although I tested that both versions work equally fast, so probably it's too strict here. Anyway, are these warnings serious?

+4
source share
2 answers

These messages (technically not even warnings) indicate that the GHC may make further optimizations (which may or may not lead to increased performance), but due to the restriction on the specialization of the constructor, this is not so. You can also get rid of them by passing -fspec-constr-count=n with a sufficiently large value of n (default 3) or -fno-spec-constr-count compiler. The result will be larger code (more specialized) that can be faster, equally fast, or slower in unsuccessful cases. If performance is critical, you should try and compare.

+4
source

These warnings can be safely ignored; they are always produced in GHC 7.0 due to internal details - basically, they are not real warnings, they just debug the output.

However, you can disable them using -dno-debug-output , according to this GHC error report .

You will no longer see them if you upgrade to GHC 7.2.

+4
source

Source: https://habr.com/ru/post/1387423/


All Articles