[Haskell-cafe] Why no instance of Happstack.Data.Default.Default for Data.ByteString.Lazy

Mads Lindstrøm mads_lindstroem at yahoo.dk
Fri Mar 19 13:18:22 EDT 2010


Why is that Happstack has:

instance Happstack.Data.Default.Default Data.ByteString

But not one for:

instance Happstack.Data.Default.Default Data.ByteString.Lazy

I am trying to make a HTTP proxy using Happstack and the client part
with the Network.HTTP (see Hackage). Network.HTTP.simpleHttp returns a
lazy Bytestring when given a lazy Bytestring (which makes sense).
Happstack on the other hand contains a lazy ByteString in its request

data Request = Request { ... rqHeaders :: Headers, ... rqBody ::
RqBody ... }

newtype RqBody = Body Data.ByteString.Lazy.Internal.ByteString

which Happstack.Server.SimpleHttp.simpleHTTP feeds into my application.
However Happstack.Server.SimpleHttp.simpleHTTP expects something
returned which is an instance of Happstack.Data.Default.Default which
lazy ByteString is not.

Confused? So am I. Who thought String handling could be so complex.


Mads Lindstrøm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100319/e0805233/attachment-0001.bin

More information about the Haskell-Cafe mailing list