[Haskell-cafe] Re: [Haskell] ANN: HLint 1.0

Felipe Lessa felipe.lessa at gmail.com
Sat Dec 20 09:47:22 EST 2008


On Sat, Dec 20, 2008 at 12:28 PM, Bulat Ziganshin
<bulat.ziganshin at gmail.com> wrote:
> Saturday, December 20, 2008, 4:38:10 PM, you wrote:
>> Why not:
>> (4 == length "TAG ") && ("TAG " `isPrefixOf` just_name pinfo)
>
>> I assume the (==) referred to in the name of the fix is the one in the
>> suggestion. Why doesn't the suggestion come with the check removed? I.e.:
>
> due to Turing computability problem, i believe :)  although Neil may
> try to run it in separate thread :)

In the general case it is, but most of the time we use a constant as
first argument to isPrefixOf and as such its length may be calculated
in finite (and very small) time. This is a special case worth taking
care of, I think.

-- 
Felipe.


More information about the Haskell-Cafe mailing list