On Sat, Dec 20, 2008 at 12:28 PM, Bulat Ziganshin <bulat.zigans...@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. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe