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. Re:  Defaulting the following constraint .... (Alan Buxton)
   2.  auto set objects imported (Nathan H?sken)


----------------------------------------------------------------------

Message: 1
Date: Thu, 3 Oct 2013 19:48:45 +0100
From: Alan Buxton <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Defaulting the following constraint
        ....
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Thanks a lot

Best
A

??? ?? iPad ???

3 Oct 2013, 19:33, ?/? Brandon Allbery <[email protected]> ??????:

>> On Thu, Oct 3, 2013 at 1:52 PM, Alan Buxton <[email protected]> wrote:
>> niceShow x = if isInt x then show (floor x :: Int) else show x
>>  
>> 
>> I get a warning about a ?too strict if?. If I then follow the recommendation 
>> and change niceShow to be
>> 
>>  
>> 
>> show (if isInt x then (floor x :: Int) else x)
>> 
>>  
>> 
>> Then I get an error that Couldn't match expected type `Int' with actual type 
>> `Double'   which makes sense because floor x :: Int produces an Int but x 
>> alone is a Double. Surely hlint could have figured this out from the type 
>> signatures and not made the recommendation to change my if structure?
>> 
>> 
> 
> hlint doesn't recognize types, only code structure to some extent (it is a 
> parser, not a compiler). As such, it will sometimes produce bad advice like 
> that.
> 
> "Too strict if" pretty much means what you saw... that you have the same 
> structure in both legs and it thinks you should abstract it out. But, as I 
> noted, it doesn't know about types so it can't recognize that you can't type 
> the refactored expression. In fact I'd generally claim that "Too strict if" 
> is by far its worst designed diagnostic, because of its inability to 
> recognize types and because the resulting message is incomprehensible.
> 
> In short, take hlint's diagnostics with several grains of salt.
> 
> -- 
> brandon s allbery kf8nh                               sine nomine associates
> [email protected]                                  [email protected]
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20131003/c0aec0ba/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 04 Oct 2013 12:53:15 +0200
From: Nathan H?sken <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] auto set objects imported
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hey,

It seems to be good practice, to explicitly say, which objects one wants 
to import in an import statement:

import SomeModule (someFunc)

while this is good documentation, it can be cumbersome to maintain.
So I was wondering: Is there some tool, that automaticly finds out which 
functions I use from which module and modifies my import statements?
That would be most usefull!

Regards,
Nathan


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 64, Issue 8
****************************************

Reply via email to