Niklas Hambüchen | 27 Mar 01:50 2013

Word8 literals in ByteString haddock?

Hey,

according to
http://hackage.haskell.org/packages/archive/bytestring/0.10.2.0/doc/html/Data-ByteString.html#v:split
I can write:

split '\n' "a\nb\nd\ne"

Can I really do that? I don't know of a way to make a '\n' literal be a
Word8, so maybe these Haddocks are wrong? I guess they would apply for
Data.ByteString.Char8, but this is Data.ByteString. Or is there a way?

Niklas
Francesco Mazzoli | 27 Mar 09:08 2013
Picon

Re: Word8 literals in ByteString haddock?

At Wed, 27 Mar 2013 00:50:21 +0000,
Niklas Hambüchen wrote:
> Hey,
> 
> according to
> http://hackage.haskell.org/packages/archive/bytestring/0.10.2.0/doc/html/Data-ByteString.html#v:split
> I can write:
> 
> split '\n' "a\nb\nd\ne"
> 
> Can I really do that? I don't know of a way to make a '\n' literal be a
> Word8, so maybe these Haddocks are wrong? I guess they would apply for
> Data.ByteString.Char8, but this is Data.ByteString. Or is there a way?

No, there is no way—you’d need an ‘OverloadedChars’ extension that does not
exist.  I think that text is meant to show the semantics of ‘split’ rather than
being actual code.

Francesco

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane