[Haskell-beginners] string -> bytestring

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Tue Jan 1 14:31:50 CET 2013


See the answer to 
http://stackoverflow.com/questions/12576817/couldnt-match-expected-type-with-actual-type-error-when-using-codec-bmp

In the future, provide a small code snippet as well so that anyone 
helping can easily point out where you're messing up.

On 01/01/13 12:03, Iustin Pop wrote:
> On Tue, Jan 01, 2013 at 01:53:44AM -0900, Christopher Howard wrote:
>> Hi. I'm trying to use pcre-light in a small text-manip app. However, the
>> module seems to want the incoming text data as a ByteString, whereas I
>> in my child-like naivety am taking the data from stdin as Strings. After
>> searching around, I tried using the fromString function from
>> Data.ByteString.UTF8 to convert from String to ByteString; but all I get is:
>>
>> code:
>> --------
>> Couldn't match expected type `ByteString'
>> with actual type `bytestring-0.9.2.1:Data.ByteString.Internal.ByteString'
>> --------
>>
>> So I'm not sure what to do.
> Is it a mismatch between strict and lazy bytestrings?
>
> iustin
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners




More information about the Beginners mailing list