Data.ByteString: copyCStringLen not in the IO monad

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Data.ByteString: copyCStringLen not in the IO monad

Tomasz Zielonka
Hello!

Why copyCStringLen :: CStringLen -> ByteString? It seems pretty
dangerous, because at the time of forcing (copyCStringLen csLen),
csLen may no longer be valid. I think it would be better if this
and other similar functions returned their results in the IO monad.

Best regards
Tomasz
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Data.ByteString: copyCStringLen not in the IO monad

Donald Bruce Stewart
tomasz.zielonka:
> Hello!
>
> Why copyCStringLen :: CStringLen -> ByteString? It seems pretty
> dangerous, because at the time of forcing (copyCStringLen csLen),
> csLen may no longer be valid. I think it would be better if this
> and other similar functions returned their results in the IO monad.
>

That's reasonable. I'll look at this.

-- Don
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries