RE: vector: ‘ANN type’ without GHCi

Simon Peyton Jones simonpj at microsoft.com
Tue Apr 1 13:05:09 UTC 2014


It might be a much nicer story if stage-1 builds simply ignored ANN pragmas entirely.
That’s just what happens: it’s a non-fatal warning:

Foo.hs:5:1: Warning:
    Ignoring ANN annotation, because this is a stage-1 compiler or doesn't support GHCi


Simon


From: Libraries [mailto:libraries-bounces at haskell.org] On Behalf Of Edward Kmett
Sent: 31 March 2014 00:22
To: Nikita Karetnikov
Cc: Haskell Libraries
Subject: Re: vector: ‘ANN type’ without GHCi

Unfortunately, that pragma pretty much makes the difference between vector being fast, getting benefits out of stream fusion for all those intermediate stream types and not.

It might be a much nicer story if stage-1 builds simply ignored ANN pragmas entirely.

As it is I get complaints from distribution maintainers with wide distributions about any use of module or function annotations for HLint, and this particular ForceSpecConstr annotation has come up as a source of pain for Austin before, though I've forgotten the details as to why.

-Edward

On Sun, Mar 30, 2014 at 6:05 PM, Nikita Karetnikov <nikita at karetnikov.org<mailto:nikita at karetnikov.org>> wrote:
The latest Hackage version and HEAD fail to build on mips64el due to the
ANN pragma in ‘Data/Vector/Fusion/Stream/Monadic.hs’:

[ 5 of 21] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for mipsel-unknown-linux):
        Cant do annotations without GHCi
    {Data/Vector/Fusion/Stream/Monadic.hs:104:19-33}
    base:GHC.Exts.ForceSpecConstr{d r2i8}

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Here’s the relevant part of the code:

data SPEC = SPEC | SPEC2
#if __GLASGOW_HASKELL__ >= 700
{-# ANN type SPEC ForceSpecConstr #-}
#endif

Is it possible to use CPP along with some configure flag to determine if
GHCi is available, and if it is not, skip the said pragma?  I tested the
Hackage version, and it builds fine if I comment out the mentioned
lines.

Does the lack of the pragma make a big difference?  (The relevant
section of the GHC manual is very brief.)

_______________________________________________
Libraries mailing list
Libraries at haskell.org<mailto:Libraries at haskell.org>
http://www.haskell.org/mailman/listinfo/libraries

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140401/f4724499/attachment.html>


More information about the Libraries mailing list