[Haskell-beginners] problems using bytestrings
Joe Van Dyk
joe at fixieconsulting.com
Thu Jan 21 22:17:15 EST 2010
On Tue, Jan 19, 2010 at 2:11 PM, Daniel Fischer
<daniel.is.fischer at web.de> wrote:
> Am Dienstag 19 Januar 2010 22:34:41 schrieb Joe Van Dyk:
>>
>> Thanks for the response. I was getting confused -- I'm used to
>> thinking about a String as being its own type, instead of being an
>> array of chars.
>
> Lists are NOT arrays.
>
> If it was not just loose language on your side, learn the distinction.
> List indexing (list !! k) is O(min k (length list)), array indexing is
> O(1).
> An array knows its size (resp. it can easily be calculated from the known
> bounds), a list does not. length list is O(length list).
>
> If you're not aware of the differences, sooner rather than later, you'll
> get bitten by a gigantic performance bug.
Whoops, yes, I know that -- I'm just used to languages where it's not
as big a deal. :D
Joe
More information about the Beginners
mailing list