Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. haskell error message (Sunil S Nandihalli)
2. Re: haskell error message (Daniel Fischer)
3. Re: haskell error message (Ozgur Akgun)
4. Re: haskell error message (Daniel Fischer)
5. Re: haskell error message (Ozgur Akgun)
6. Re: haskell error message (Daniel Fischer)
7. Fwd: Strange behavior (Luca Ciciriello)
8. Re: haskell error message (Ozgur Akgun)
----------------------------------------------------------------------
Message: 1
Date: Mon, 29 Aug 2011 16:45:37 +0530
From: Sunil S Nandihalli <[email protected]>
Subject: [Haskell-beginners] haskell error message
To: beginners <[email protected]>
Message-ID:
<cap0fd73jhrdncpdvnhr3pbpw1+m7r0dyvhky5ywpqdryv1_...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi everybody,
can somebody explain as to what the following error message means..
[1 of 1] Compiling Main ( main.hs, main.o )
SpecConstr
Function `$wf{v s3mp} [lid]'
has four call patterns, but the limit is 3
Use -fspec-constr-count=n to set the bound
Use -dppr-debug to see specialisations
SpecConstr
Function `$wf{v X3sC} [lid]'
has three call patterns, but the limit is 1
Use -fspec-constr-count=n to set the bound
Use -dppr-debug to see specialisations
Linking main ...
Thanks,
Sunil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110829/3d5c8dbc/attachment-0001.htm>
------------------------------
Message: 2
Date: Mon, 29 Aug 2011 13:56:34 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="utf-8"
On Monday 29 August 2011, 13:15:37, Sunil S Nandihalli wrote:
> Hi everybody,
> can somebody explain as to what the following error message means..
Fortunately, it's not an error message, not even a serious warning.
It shouldn't really be shown to the user unless (s)he asks the compiler to
be really thorough in reporting "problems".
The thing is, with optimisations (I'm not sure whether -O suffices or one
needs -O2) GHC specialises functions by call pattern, meaning, by the
constructors of the arguments.
The number of possible specialisations can become huge for recursive
functions, so there's a limit how many specialisations GHC will create for
any function - the default limit is, iirc, 3 - and when specialising a
callee, the limit is divided by the number of specialisations of the caller
so you don't get exponential code growth.
Now
>
> [1 of 1] Compiling Main ( main.hs, main.o )
> SpecConstr
> Function `$wf{v s3mp} [lid]'
> has four call patterns, but the limit is 3
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
> SpecConstr
> Function `$wf{v X3sC} [lid]'
> has three call patterns, but the limit is 1
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
means that these functions have more call patterns to specialise for than
the current limit allows, so GHC doesn't create these specialisations.
The first seems to be a first-generation specialisation candidate and the
second a second-generation candidate since its limit has dropped to 1.
It's nothing serious, just a possible missed optimisation [that can have a
big impact, but normally it doesn't make too much difference; on the other
hand, occasionally the constructor specialisation is a pessimisation, so
you can turn it off with -fno-spec-constr].
If you set the limit high enough with -fspec-constr-count=n, GHC will
create all specialisations it thinks will be good and doesn't lose a word
about it.
Really, it shouldn't reach the console unless the user asks for it, but
somebody forgot to remove it from the diagnostics by default.
> Linking main ...
>
>
> Thanks,
> Sunil.
------------------------------
Message: 3
Date: Mon, 29 Aug 2011 14:00:19 +0100
From: Ozgur Akgun <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<CALzazPBsH0G7T=bb5vkwm7tk-gjh-4epcii42vq3ekgqycl...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Daniel,
Thanks a lot for the answer, I was about to ask a similar question just now.
One more question though, I found documentation about this and tried setting
-fspec-constr-count=10 in my cabal file under ghc-options, but it didn't
seem to make a difference. The compiler still generates the warning.
Why do you think this can be?
Best,
Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110829/1560f7a3/attachment-0001.htm>
------------------------------
Message: 4
Date: Mon, 29 Aug 2011 15:20:26 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: Ozgur Akgun <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="utf-8"
On Monday 29 August 2011, 15:00:19, Ozgur Akgun wrote:
> Daniel,
>
> Thanks a lot for the answer, I was about to ask a similar question just
> now.
>
> One more question though, I found documentation about this and tried
> setting -fspec-constr-count=10 in my cabal file under ghc-options, but
> it didn't seem to make a difference. The compiler still generates the
> warning.
>
> Why do you think this can be?
Too large fan-out, probably.
Try a larger value or use the sledgehammer method and turn off the limit:
-fno-spec-constr-count
>
> Best,
> Ozgur
------------------------------
Message: 5
Date: Mon, 29 Aug 2011 14:31:09 +0100
From: Ozgur Akgun <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<CALzazPAoqhem48jK6oOpYk7ibm8nnzLF=m4mr8esavvjbhw...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On 29 August 2011 14:20, Daniel Fischer <[email protected]>wrote:
> Try a larger value or use the sledgehammer method and turn off the limit:
> -fno-spec-constr-count
>
Yes I tried this and it removes the warnings.
Strangest thing is, when I set -f-spec-constr-count to 10, the generated
warning is "... has four call patterns, but the limit is 3 ...". Somehow it
doesn't say the limit is 10.
Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110829/6246b9d6/attachment-0001.htm>
------------------------------
Message: 6
Date: Mon, 29 Aug 2011 15:49:14 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: Ozgur Akgun <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="utf-8"
On Monday 29 August 2011, 15:31:09, Ozgur Akgun wrote:
> On 29 August 2011 14:20, Daniel Fischer
<[email protected]>wrote:
> > Try a larger value or use the sledgehammer method and turn off the
> > limit: -fno-spec-constr-count
>
> Yes I tried this and it removes the warnings.
>
> Strangest thing is, when I set -f-spec-constr-count to 10, the generated
> warning is "... has four call patterns, but the limit is 3 ...". Somehow
> it doesn't say the limit is 10.
Second generation.
You have a function with three call patterns (and no previous constructor
specialisation), limit is 10, fine, specialise.
This function calls a worker. Now, since we had three specialisations
above, the limit here is 10 `div` 3 = 3.
The worker would have four call patterns;
4 > 3 => message "Hi there, I could have done more, but the limit said I
shouldn't. You might want to set a higher limit if you think it's
worthwhile to specialise."
Cheers,
Daniel
------------------------------
Message: 7
Date: Mon, 29 Aug 2011 15:52:16 +0200
From: Luca Ciciriello <[email protected]>
Subject: [Haskell-beginners] Fwd: Strange behavior
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Begin forwarded message:
> From: Luca Ciciriello <[email protected]>
> Subject: Re: [Haskell-beginners] Strange behavior
> Date: August 29, 2011 3:43:39 PM GMT+02:00
> To: Daniel Fischer <[email protected]>
>
> I'm very sorry. My mistake.
> foldP works as expected as shown by the code below:
>
> {-# LANGUAGE PArr, ParallelListComp #-}
> {-# OPTIONS -fdph-seq #-}
>
> module Test where
>
> import GHC.PArr
>
>
> boolArr = [: False, False, False :]
>
> isTrue :: Bool
> isTrue = foldP (||) False [: x | x <- boolArr :]
>
> Here the result of "isTrue" is False, as expected.
> So, seems that the only problem is about "elemP"
>
> Sorry again.
>
> Luca.
>
>
> On Aug 29, 2011, at 3:28 PM, Daniel Fischer wrote:
>
>> Hi Luca,
>>
>> On Monday 29 August 2011, 11:57:05, you wrote:
>>> Ok, Thanks.
>>> This works fine. I found out that also mapP and sumP are working as
>>> expected, but elemP and foldP do not behave correctly.
>>
>> Have you a short example of foldP behaving wrongly?
>> The dph people will have it easier to find the bug if they have one.
>>
>> Cheers,
>> Daniel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110829/f491190a/attachment-0001.htm>
------------------------------
Message: 8
Date: Mon, 29 Aug 2011 14:57:21 +0100
From: Ozgur Akgun <[email protected]>
Subject: Re: [Haskell-beginners] haskell error message
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<CALzazPDtL=x3ubk+lgb01c_qubcrs2vknhtwuswpanwrl6u...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Thanks a lot Daniel, great explanation!
On 29 August 2011 14:49, Daniel Fischer <[email protected]>wrote:
> You have a function with three call patterns (and no previous constructor
> specialisation), limit is 10, fine, specialise.
>
> This function calls a worker. Now, since we had three specialisations
> above, the limit here is 10 `div` 3 = 3.
> The worker would have four call patterns;
> 4 > 3 => message "Hi there, I could have done more, but the limit said I
> shouldn't. You might want to set a higher limit if you think it's
> worthwhile to specialise."
>
Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110829/397b1d2f/attachment.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 38, Issue 47
*****************************************