Galchin, Vasili | 13 Jan 23:09

ByteString intercalate semantics??

Hello,

     From Hoogle (my friend) ....

intercalate :: ByteString -> [ByteString] -> ByteString Source
O(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list.




So intercalate doesn't do a simple concatenation?

Vasili
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Don Stewart | 13 Jan 23:17
Gravatar

Re: ByteString intercalate semantics??

vigalchin:
>    Hello,
> 
>         From Hoogle (my friend) ....
> 
>    intercalate :: [1]ByteString -> [[2]ByteString] -> [3]ByteString [4]Source 
>    O(n) The [5]intercalate function takes a [6]ByteString and a list of       
>    [7]ByteStrings and concatenates the list after interspersing the first     
>    argument between each element of the list.                                 
>    So intercalate doesn't do a simple concatenation?                          

FWIW.

    concat . intersperse x == intercalate x

-- Don

Gmane