Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GHC clutter while compilation

Tags:

haskell

ghc

GHC 7.0.3 (ubuntu repoes) produces during compilation warnings of kind

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've made my own datatype, when I make it strict there are these warnings, when it is lazy, there are no. Though I've tested both versions run equally fast, so probably strictness is excessive here. Anyway are these warnings serious?

like image 877
Yrogirg Avatar asked Feb 22 '23 01:02

Yrogirg


2 Answers

These messages (technically not even warnings) indicate that GHC could do further optimisations (which might or might not result in improved performance), but due to the limit placed on constructor specialisation doesn't. You could also get rid of them by passing -fspec-constr-count=n with a sufficiently large n (default is 3) or -fno-spec-constr-count to the compiler. The result would be larger code (more specialisations), which could be faster, equally fast, or in unfortunate cases slower. If performance is critical, you should try and compare.

like image 77
Daniel Fischer Avatar answered Feb 24 '23 16:02

Daniel Fischer


These warnings can be safely ignored; they are always produced in GHC 7.0 because of internal details — basically, they're not real warnings, just debug output.

However, you can turn them off using -dno-debug-output, according to this GHC bug report.

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

like image 42
ehird Avatar answered Feb 24 '23 15:02

ehird