Am 20.10.2011 21:43, schrieb Michael Snoyman:
On Wed, Oct 19, 2011 at 9:29 PM, Ketil Maldeke...@malde.org wrote:
Michael Snoymanmich...@snoyman.com writes:
sense to try and pursue something like what you're suggesting, but I
think the default Show (Vector Word8) should be the one most
On Fri, Oct 21, 2011 at 11:58 AM, Christian Maeder
christian.mae...@dfki.de wrote:
Am 20.10.2011 21:43, schrieb Michael Snoyman:
On Wed, Oct 19, 2011 at 9:29 PM, Ketil Maldeke...@malde.org wrote:
Michael Snoymanmich...@snoyman.com writes:
sense to try and pursue something like what you're
On Wed, Oct 19, 2011 at 9:29 PM, Ketil Malde ke...@malde.org wrote:
Michael Snoyman mich...@snoyman.com writes:
sense to try and pursue something like what you're suggesting, but I
think the default Show (Vector Word8) should be the one most useful,
most of the time, and I think the general
Conrad Parker wrote:
On 15 October 2011 23:18, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 16 October 2011 01:15, Bas van Dijk v.dijk@gmail.com wrote:
I agree that you shouldn't use ByteStrings or Vectors of Word8s for
Unicode strings. However I can imagine that for quick
On 19 October 2011 22:09, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
So it seems that (1) people have very different requirements and (2) the
Show instance only really matters for debugging in ghci. Here is a
thought. What if ghci allowed Show instances to be overridden dynamically?
So
On Wed, Oct 19, 2011 at 1:09 PM, Roman Leshchinskiy r...@cse.unsw.edu.au
wrote:
So it seems that (1) people have very different requirements and (2) the
Show instance only really matters for debugging in ghci. Here is a
thought. What if ghci allowed Show instances to be overridden
On Oct 19, 2011, at 7:32 AM, Ivan Lazar Miljenovic wrote:
On 19 October 2011 22:09, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
So it seems that (1) people have very different requirements and (2) the
Show instance only really matters for debugging in ghci. Here is a
thought. What if
On 19 October 2011 15:59, AM age...@themactionfaction.com wrote:
Note that other programming languages have had to solve this exact problem
and they usually end up with multiple functions- one for debugging, one for
serialization, one for displaying how the object was constructed.
As per
On Wed, Oct 19, 2011 at 9:49 AM, Stephen Tetley
stephen.tet...@gmail.com wrote:
On 19 October 2011 15:59, AM age...@themactionfaction.com wrote:
Note that other programming languages have had to solve this exact problem
and they usually end up with multiple functions- one for debugging, one
Ivan Lazar Miljenovic wrote:
On 19 October 2011 22:09, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
So it seems that (1) people have very different requirements and (2) the
Show instance only really matters for debugging in ghci. Here is a
thought. What if ghci allowed Show instances to be
Michael Snoyman mich...@snoyman.com writes:
sense to try and pursue something like what you're suggesting, but I
think the default Show (Vector Word8) should be the one most useful,
most of the time, and I think the general consensus seems to be the
current ByteString instance fits that role.
On 10/18/2011 01:30 AM, Conrad Parker wrote:
And I often work with mixed text/binary data (eg. text annotations in
video streams). I'd want the Show/Read instances to be in the form of
a hexdump with char representation alongside (like xxd or od -xc
output). It roundtrips well, so why not? :-)
Am 12.10.2011 16:02, schrieb Bas van Dijk:
API DOCS
http://hackage.haskell.org/package/vector-bytestring-0.0.0.0
you could re-export VS.empty, VS.singleton, etc. directly.
Cheers Christian
-- | /O(1)/ The empty 'ByteString'
empty :: ByteString
empty = VS.empty
{-# INLINE empty #-}
-- |
2011/10/18 Christian Maeder christian.mae...@dfki.de:
you could re-export VS.empty, VS.singleton, etc. directly.
The vector singleton and the vector-bytestring singleton don't have
the same type.
vector:
singleton :: a - Vector a
vector-bytestring:
singleton :: Word8 - Vector Word8
By
2011/10/18 Roel van Dijk vandijk.r...@gmail.com:
Maybe we [can] create an example program which would fail with the
more general type.
Migrating the function foo from bytestring to vector-bytestring
would fail with more general types:
import Data.ByteString
foo = print empty
Ok, modules
I think the cleanest solution (just from a theoretical point of view) is
to use a newtype for your byte strings.
- it should have the same performance
- allows to make ByteString really abstract when hiding the newtype
constructor
- is portable and supplies control over all other instances
And you could just use GeneralizedNewtypeDeriving extension. Then you could
use functions from Data.Vector.Generic on your ByteStrings.
Much cleaner IMO than OverlappingInstances.
2011/10/17 Christian Maeder christian.mae...@dfki.de
I think the cleanest solution (just from a theoretical point
Christian Maeder christian.mae...@dfki.de wrote:
I think the cleanest solution (just from a theoretical point of view)
is to use a newtype for your byte strings.
- it should have the same performance
- allows to make ByteString really abstract when hiding the newtype
constructor
- is
Am 17.10.2011 11:10, schrieb Ertugrul Soeylemez:
So please, please, please, if you decide to use a newtype, do /not/ hide
the constructor.
The better alternative to not hiding the constructor is to supply
conversion functions that may or may not do more than the constructor
and selector and
On 17 October 2011 10:18, Christian Maeder christian.mae...@dfki.de wrote:
I think the cleanest solution (just from a theoretical point of view) is to
use a newtype for your byte strings.
- it should have the same performance
- allows to make ByteString really abstract when hiding the newtype
On Mon, Oct 17, 2011 at 12:14 PM, Bas van Dijk v.dijk@gmail.com wrote:
On 17 October 2011 10:18, Christian Maeder christian.mae...@dfki.de wrote:
I think the cleanest solution (just from a theoretical point of view) is to
use a newtype for your byte strings.
- it should have the same
Hi,
On 17.10.2011, at 12:14, Bas van Dijk wrote:
On 17 October 2011 10:18, Christian Maeder christian.mae...@dfki.de wrote:
My idea is that when vector-bytestring is as fast as bytestring, it
can replace it. When that happens it doesn't matter if users use the
vector interface. I would
Am 17.10.2011 12:14, schrieb Bas van Dijk:
On 17 October 2011 10:18, Christian Maederchristian.mae...@dfki.de wrote:
I think the cleanest solution (just from a theoretical point of view) is to
use a newtype for your byte strings.
- it should have the same performance
- allows to make
Am 17.10.2011 12:19, schrieb Michael Snoyman:
[...]
Also, aren't there a few documented cases where newtypes prevent
certain GHC rewrite rules from firing?
This would be possible to find out with a wrapper module.
Cheers Christian
I don't see any strong argument to avoid what appears to be
Christian Maeder christian.mae...@dfki.de wrote:
So please, please, please, if you decide to use a newtype, do /not/
hide the constructor.
The better alternative to not hiding the constructor is to supply
conversion functions that may or may not do more than the constructor
and selector
Michael Snoyman wrote:
On Mon, Oct 17, 2011 at 12:14 PM, Bas van Dijk v.dijk@gmail.com
wrote:
My idea is that when vector-bytestring is as fast as bytestring, it
can replace it. When that happens it doesn't matter if users use the
vector interface. I would even recommend it over using
On Mon, Oct 17, 2011 at 4:42 PM, Roman Leshchinskiy r...@cse.unsw.edu.au
wrote:
Michael Snoyman wrote:
On Mon, Oct 17, 2011 at 12:14 PM, Bas van Dijk v.dijk@gmail.com
wrote:
My idea is that when vector-bytestring is as fast as bytestring, it
can replace it. When that happens it doesn't
On 17 October 2011 16:44, Michael Snoyman mich...@snoyman.com wrote:
On Mon, Oct 17, 2011 at 4:42 PM, Roman Leshchinskiy r...@cse.unsw.edu.au
wrote:
Michael Snoyman wrote:
On Mon, Oct 17, 2011 at 12:14 PM, Bas van Dijk v.dijk@gmail.com
wrote:
My idea is that when vector-bytestring is
On 17 October 2011 13:12, Christian Maeder christian.mae...@dfki.de wrote:
Am 17.10.2011 12:14, schrieb Bas van Dijk:
On 17 October 2011 10:18, Christian Maederchristian.mae...@dfki.de
wrote:
I think the cleanest solution (just from a theoretical point of view) is
to
use a newtype for
Am 17.10.2011 17:26, schrieb Bas van Dijk:
On 17 October 2011 13:12, Christian Maederchristian.mae...@dfki.de wrote:
So your package basically supports an unfortunate mix of bytestring and
vector functions?
No, vector-bytestring exports the same API as bytestring (except for
the Show and
It's a good question, I don't think there is something in the vector library
that can handle chunks of vectors...
If both lazy and strict bytestrings are to be generalized, it would *at last
* permit to have a single interface to them, thanks to Data.Vector.Generic,
and no longer two identical
On 17 October 2011 20:15, Yves Parès limestr...@gmail.com wrote:
It's a good question, I don't think there is something in the vector library
that can handle chunks of vectors...
Yes I forgot about lazy bytestrings when writing that. Of course
vector-bytestring does provide lazy ByteStrings.
On 17 October 2011 18:28, Christian Maeder christian.mae...@dfki.de wrote:
Am 17.10.2011 17:26, schrieb Bas van Dijk:
On 17 October 2011 13:12, Christian Maederchristian.mae...@dfki.de
wrote:
So your package basically supports an unfortunate mix of bytestring and
vector functions?
No,
On 15 October 2011 23:18, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 16 October 2011 01:15, Bas van Dijk v.dijk@gmail.com wrote:
I agree that you shouldn't use ByteStrings or Vectors of Word8s for
Unicode strings. However I can imagine that for quick sessions in ghci
it can
On Mon, Oct 17, 2011 at 10:30 PM, Conrad Parker con...@metadecks.org wrote:
And I often work with mixed text/binary data (eg. text annotations in
video streams). I'd want the Show/Read instances to be in the form of
a hexdump with char representation alongside (like xxd or od -xc
output). It
On 15 October 2011 23:56, Bas van Dijk v.dijk@gmail.com wrote:
On 15 October 2011 23:17, Ertugrul Soeylemez e...@ertes.de wrote:
Both instances are valid here, and there is no mechanism to choose one of
them.
There is: OverlappingInstances[1] chooses the most specific instance.
So in
On 16 October 2011 08:51, Stephen Tetley stephen.tet...@gmail.com wrote:
On 15 October 2011 23:56, Bas van Dijk v.dijk@gmail.com wrote:
On 15 October 2011 23:17, Ertugrul Soeylemez e...@ertes.de wrote:
Both instances are valid here, and there is no mechanism to choose one of
them.
There
On 16 October 2011 10:06, Bas van Dijk v.dijk@gmail.com wrote:
But is this a problem when both instances are exported from the same
module and OverlappingInstances is only enabled in that module, as is
the case here?
No - if the only instances defined are in the same module GHC would
Bas van Dijk v.dijk@gmail.com wrote:
On 15 October 2011 23:17, Ertugrul Soeylemez e...@ertes.de wrote:
Both instances are valid here, and there is no mechanism to choose
one of them.
There is: OverlappingInstances[1] chooses the most specific instance.
So in case someVector :: Vector
Felipe Almeida Lessa felipe.le...@gmail.com wrote:
Although I don't have a problem with using language extensions the
vector package, as it is a commonly used tool, shouldn't require me
to use an extension just to be able to debug my code. This would be
particularly annoying when using
On 14/10/2011, at 12:37, Bas van Dijk wrote:
If there's need for a specific Show instance for Vectors of Word8s we
can always add one directly to vector. (Roman, what are your thoughts
on this?)
Personally, I think that ByteString and especially Vector Word8 aren't strings
and shouldn't be
On 15/10/2011, at 12:26, Roman Leshchinskiy wrote:
On 14/10/2011, at 12:37, Bas van Dijk wrote:
If there's need for a specific Show instance for Vectors of Word8s we
can always add one directly to vector. (Roman, what are your thoughts
on this?)
Personally, I think that ByteString and
On 15 October 2011 13:34, Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
On 15/10/2011, at 12:26, Roman Leshchinskiy wrote:
On 14/10/2011, at 12:37, Bas van Dijk wrote:
If there's need for a specific Show instance for Vectors of Word8s we
can always add one directly to vector. (Roman, what
Hi,
Am Samstag, den 15.10.2011, 16:15 +0200 schrieb Bas van Dijk:
So what do other people think about this?
having a human-readable Show instance for ByteStrings is definitely a
great plus when debugging code.
Greetings,
Joachim
--
Joachim nomeata Breitner
m...@joachim-breitner.de |
On 16 October 2011 01:15, Bas van Dijk v.dijk@gmail.com wrote:
I agree that you shouldn't use ByteStrings or Vectors of Word8s for
Unicode strings. However I can imagine that for quick sessions in ghci
it can be quite handy if they are shown as strings. For example,
currently we have:
Joachim Breitner m...@joachim-breitner.de wrote:
So what do other people think about this?
having a human-readable Show instance for ByteStrings is definitely a
great plus when debugging code.
I agree and would even go as far as saying that it's generally useful,
even if the data is not
On 15 October 2011 20:50, Ertugrul Soeylemez e...@ertes.de wrote:
Roman Leshchinskiy r...@cse.unsw.edu.au wrote:
Personally, I think that ByteString and especially Vector Word8
aren't strings and shouldn't be treated as such. But I wouldn't be
strongly against showing them as strings.
Bas van Dijk v.dijk@gmail.com wrote:
My suggestion was to remove the generic Show instance and add only
specialized instances. This is more work, but will also yield
better results. In particular, it allows specialized string
representations for other types, too.
What exactly is
On 15 October 2011 23:17, Ertugrul Soeylemez e...@ertes.de wrote:
Both instances are valid here, and there is no mechanism to choose one of
them.
There is: OverlappingInstances[1] chooses the most specific instance.
So in case someVector :: Vector Word8 the instance Show (Vector Word8)
is
Am 12.10.2011 16:02, schrieb Bas van Dijk:
All your ByteString are belong to us...
Hello,
I'm pleased to announce the beta release of vector-bytestring. This
library provides the type ByteString which is defined as a type
synonym for a storable Vector of Word8s (from the vector package):
On 14 October 2011 12:58, Christian Maeder christian.mae...@dfki.de wrote:
Would it not be simple to use a newtype for ByteString (rather than a
synonym)?
My vision for the future of bytestring and vector-bytestring is that
they will be replaced by vector directly. This way users don't have to
On 14 October 2011 22:37, Bas van Dijk v.dijk@gmail.com wrote:
On 14 October 2011 12:58, Christian Maeder christian.mae...@dfki.de wrote:
Would it not be simple to use a newtype for ByteString (rather than a
synonym)?
If there's need for a specific Show instance for Vectors of Word8s we
On Fri, Oct 14, 2011 at 13:45, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Though I would argue that unless you're trying to actually use for
Show/Read for serialisation, does it really matter what the Show/Read
instances for Bytestring are?
Convenient debugging and REPL interaction
Max Rabkin max.rab...@gmail.com wrote:
Though I would argue that unless you're trying to actually use for
Show/Read for serialisation, does it really matter what the
Show/Read instances for Bytestring are?
Convenient debugging and REPL interaction certainly matter!
On the other hand,
On 14 October 2011 13:37, Bas van Dijk v.dijk@gmail.com wrote:
If there's need for a specific Show instance for Vectors of Word8s we
can always add one directly to vector. (Roman, what are your thoughts
on this?)
Ok I have proposed and implemented this for vector:
All your ByteString are belong to us...
Hello,
I'm pleased to announce the beta release of vector-bytestring. This
library provides the type ByteString which is defined as a type
synonym for a storable Vector of Word8s (from the vector package):
type ByteString = Data.Vector.Storable.Vector
56 matches
Mail list logo