[Haskell-cafe] Is bumping the version number evil, if it's not mandated by the PVP?

2010-08-14 Thread Sebastian Fischer
Hello, I wonder whether (and how) I should increase the version number of a library when the API does not change but the implementation gets more efficient. Should I bump a.b.C or even a.B to signal that it's worth using the new version or should I bump only a.b.c.D such that packages tha

Re: [Haskell-cafe] ANNOUNCE: Sifflet visual programming language, release 1.0!

2010-08-14 Thread Andrew Coppin
gdwe...@iue.edu wrote: About Sifflet - Sifflet is a visual, functional programming language intended as an aid for learning about recursion. * A picture explains Sifflet better than words: please see the screenshot showing how to evaluate 3!: http://mypage.iu.edu/~gdweber/

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Andrew Coppin
Johan Tibell wrote: On Fri, Aug 13, 2010 at 4:24 PM, Kevin Jardine > wrote: One of the more puzzling aspects of Haskell for newbies is the large number of libraries that appear to provide similar/duplicate functionality. I agree. Here's a rule of thu

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Florian Weimer
* Bryan O'Sullivan: > If you know it's text and not binary data you are working with, you should > still use Data.Text. There are a few good reasons. > >1. The API is more correct. For instance, if you use Text.toUpper on a >string containing latin1 "ß" (eszett, sharp S), you'll get the >

[Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
As I understand it, ATs were invented because FDs are "evil" and must never be used ever for any purpose. However, it doesn't seem to be possible to use ATs to do the same things that FDs can do. You can use ATs to write type functions, which take one type and return another type. This allows

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin writes: > Interesting. I've never even heard of Data.Text. When did that come > into existence? The first version hit Hackage in February last year... > More importantly: How does the average random Haskeller discover that > a package has become available that might be relevant to

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Johan Tibell
On Sat, Aug 14, 2010 at 12:15 PM, Florian Weimer wrote: > * Bryan O'Sullivan: > > > If you know it's text and not binary data you are working with, you > should > > still use Data.Text. There are a few good reasons. > > > >1. The API is more correct. For instance, if you use Text.toUpper on a

Re: [Haskell-cafe] Is bumping the version number evil, if it's not mandated by the PVP?

2010-08-14 Thread Ivan Lazar Miljenovic
Sebastian Fischer writes: > Hello, > > I wonder whether (and how) I should increase the version number of a > library when the API does not change but the implementation gets more > efficient. If the API remains the same (and the behaviour of the functions does as well), then according to the PV

Fwd: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Gábor Lehel
-- Forwarded message -- From: Gábor Lehel Date: 2010/8/14 Subject: Re: [Haskell-cafe] ATs vs FDs To: Andrew Coppin You're missing equality constraints for classes. In other words: class (a ~ Smaller (Bigger a), a ~ Bigger (Smaller a)) => Vector a where type Bigger a; type Smal

Re: [Haskell-cafe] Is bumping the version number evil, if it's not mandated by the PVP?

2010-08-14 Thread Sebastian Fischer
[CC'ing café again] On Aug 14, 2010, at 12:25 PM, Max Rabkin wrote: On Sat, Aug 14, 2010 at 11:13 AM, Sebastian Fischer wrote: Hello, I wonder whether (and how) I should increase the version number of a library when the API does not change but the implementation gets more efficient. Sh

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Andrew Coppin
Ivan Lazar Miljenovic wrote: Andrew Coppin writes: More importantly: How does the average random Haskeller discover that a package has become available that might be relevant to their work? Look on Hackage; subscribe to mailing lists (where package maintainers should really write ann

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin writes: > As I understand it, ATs were invented because FDs are "evil" and must > never be used ever for any purpose. However, it doesn't seem to be > possible to use ATs to do the same things that FDs can do. > > You can use ATs to write type functions, which take one type and > re

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
Ivan Lazar Miljenovic wrote: I assume you mean something like this? , | class NextOneUpFD this previous | this -> previous where ... | | instance NextOneUpFD Vector3 Vector4 where ... ` More like class NextPrevFD next prev | next -> prev, prev -> next where... but yeah, that's

Re: [Haskell-cafe] Is bumping the version number evil, if it's not mandated by the PVP?

2010-08-14 Thread Ross Paterson
On Sat, Aug 14, 2010 at 11:13:19AM +0200, Sebastian Fischer wrote: > I wonder whether (and how) I should increase the version number of a > library when the API does not change but the implementation gets > more efficient. > > Should I bump a.b.C or even a.B to signal that it's worth using the > n

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Stephen Tetley
On 14 August 2010 11:19, Andrew Coppin wrote: > As I understand it, ATs were invented because FDs are "evil" and must never > be used ever for any purpose. However, it doesn't seem to be possible to use > ATs to do the same things that FDs can do. > You might want to read the "Language and Progra

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin writes: > Ivan Lazar Miljenovic wrote: >> I assume you mean something like this? >> >> , >> | class NextOneUpFD this previous | this -> previous where ... >> | | instance NextOneUpFD Vector3 Vector4 where ... >> ` >> > > More like > > class NextPrevFD next prev | next -

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin writes: > Well, I suppose I don't do a lot of text processing work... If all > you're trying to do is parse commands from an interactive terminal > prompt, [Char] is probably good enough. Neither do I, yet I've heard of it... ;-) -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com

[Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Alexey Karakulov
I was inspired by George Pollard's postat haskell-cafe and tried to implement the non-polymorphic Functor class ( I named it Functor' ). I changed some names and added reasonable constraints. type family NewPt f a class F

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Ivan Lazar Miljenovic
Alexey Karakulov writes: > (Ord b) must be deduced from (Functor (Set b)) but it doesn't. I don't know > whether it's my mistake somewhere or ghc problem. I've come across this problem as well; the best solution I've seen so far is the one taken by Ganesh in his rmonad library: http://hackage.h

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Bill Atkins
Right, but if you use Prelude.interact, as in my example, you don't have to worry about the EOF checking yourself - it's all handled for you. And if you use a functional style, your code will be simpler and more testable - otherwise you might as well just use an imperative language. Here's a s

Re: [Haskell-cafe] Re: philosophy of Haskell

2010-08-14 Thread Bill Atkins
On Saturday Aug 14, 2010, at 12:50 AM, Conal Elliott wrote: > And the IO monad is what Jerzy asked about. I'm pointing out that the state > monad does not capture concurrency, and the "EDSL model" does not capture > FFI. (Really, it depends which "EDSL model". I haven't seen one that can > c

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Felipe Lessa
On Sat, Aug 14, 2010 at 9:59 AM, Bill Atkins wrote: >  | otherwise                                        = let (line, rest) = > splitAt maxLineLength line in >                                                                 line : > wrapLine rest I haven't tested myself, but does this work at

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Bill Atkins
Oof, that's what I get for making "just one little change" without testing. You're right. On Saturday Aug 14, 2010, at 9:17 AM, Felipe Lessa wrote: > On Sat, Aug 14, 2010 at 9:59 AM, Bill Atkins wrote: >> | otherwise= let (line, rest) = >> splitAt maxLi

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread michael rice
Hi Filipe, Bill Your corrected version works, while the original didn't, but it still produces incorrect output: However mean your life is, meet it and live it: do not shun it and call it hard names. Cultivate poverty like a garden herb, like sage. Do not t rouble yourself much to get new thing

Re: [Haskell-cafe] Re: gtk2hs with old gtk2

2010-08-14 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/14/10 02:20 , Andy Stewart wrote: >> Cannot find a definition for `Emblem' in the header file. > Because GEmblem is need Glib 2.18, mabye your glib is too old. > You can use command 'pkg-config --modversion glib-2.0' check your glib > version. >

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
Andrew Coppin wrote: Ivan Lazar Miljenovic wrote: If so, how does this not solve the issue? , | class NextOneUpAT v where | type Next v | ... | | instance NextOneUpAT Vector3 where | type Next Vector3 = Vector4 | ... ` Can I use that to go both up and down? Would the types

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/14/10 01:29 , Kevin Jardine wrote: > I think that this kind of programming detail should be handled > internally (even if necessary by switching automatically from UTF-8 to > UTF-16 depending upon the language). This is going to carry a heavy spe

[Haskell-cafe] Question about memory usage

2010-08-14 Thread Tako Schotanus
I was reading this article: http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_in_has.php And came to the part where it shows: > fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist)) Very interesting stuff for somebody who comes from an imperative world of course. But then I re

Re: [Haskell-cafe] Question about memory usage

2010-08-14 Thread Andrew Coppin
Tako Schotanus wrote: > fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist)) Very interesting stuff for somebody who comes from an imperative world of course. Oh yes, that old chestnut. There's a page on the wiki somewhere with a whole collection of these cryptic one-liners - Pascal's t

Re: [Haskell-cafe] Question about memory usage

2010-08-14 Thread Christopher Lane Hinson
On Sat, 14 Aug 2010, Tako Schotanus wrote: I was reading this article: http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_in_has.php And came to the part where it shows: > fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist)) But then I read that "Once it's been referenced,

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Donn Cave
Quoth Brandon S Allbery KF8NH , > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 8/14/10 01:29 , Kevin Jardine wrote: >> I think that this kind of programming detail should be handled >> internally (even if necessary by switching automatically from UTF-8 to >> UTF-16 depending upon the lang

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Antoine Latter
What's wrong with fun-deps? The associated type synonym syntax is prettier, but I didn't tknow that fun-deps were evil. Do you have any links? Take care, Antoine On Aug 14, 2010 5:19 AM, "Andrew Coppin" wrote: As I understand it, ATs were invented because FDs are "evil" and must never be used

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Gábor Lehel
I think that was exaggeration for effect. FDs aren't evil, but TFs do the same thing in a nicer way, and there's a long-term effort to move over from one to the other, and ideally get TFs into Haskell' at some point. But there's no problem with using FDs if you need them or just like them better.

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Bill Atkins
Try this one (http://gist.github.com/524460): import Data.Char maxLineLength :: Int maxLineLength = 72 trim :: String -> String trim = reverse . dropSpaces . reverse . dropSpaces where dropSpaces = dropWhile isSpace none :: (a -> Bool) -> [a] -> Bool none f = not . any f reverseBreak :: (a -

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Ronald Guida
On Sat, Aug 14, 2010 at 12:33 PM, Bill Atkins wrote: > Try this one (http://gist.github.com/524460) I noticed that Bill's solution doesn't seem to work if the input text is infinite. I found a different solution, which avoids the use of reverse, and will work even if the input is infinite, as lo

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread michael rice
Hi Bill, Very clever. You are an inspiration. Michael --- On Sat, 8/14/10, Bill Atkins wrote: From: Bill Atkins Subject: Re: [Haskell-cafe] Unwrapping long lines in text files To: "michael rice" Cc: "Felipe Lessa" , haskell-cafe@haskell.org Date: Saturday, August 14, 2010, 12:33 PM Try thi

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Alexander Solla
On Aug 14, 2010, at 9:01 AM, Antoine Latter wrote: What's wrong with fun-deps? The associated type synonym syntax is prettier, but I didn't tknow that fun-deps were evil. Do you have any links? They're not "evil", they are "tricky" and can lead to non-termination, inconsistency, etc. ht

Re: [Haskell-cafe] Question about memory usage

2010-08-14 Thread Daniel Peebles
> > In the example above, fiblist is a global variable, so the answer to "when > does it get freed?" would be "never". (I believe it's called a CAF leak.) > Is that actually true? I've heard lots of references to this, but I'm not sure it is true. Sure, it's harder for it to get collected when eve

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Don Stewart
andrewcoppin: > Interesting. I've never even heard of Data.Text. When did that come into > existence? > > More importantly: How does the average random Haskeller discover that a > package has become available that might be relevant to their work? In this case, Data.Text has been announced on t

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Alexey Karakulov
On Sat, Aug 14, 2010 at 2:27 PM, Ivan Lazar Miljenovic < ivan.miljeno...@gmail.com> wrote: > Alexey Karakulov writes: > > > > (Ord b) must be deduced from (Functor (Set b)) but it doesn't. I don't > know > > whether it's my mistake somewhere or ghc problem. > > I've come across this problem as we

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread David Menendez
On Fri, Aug 13, 2010 at 10:43 AM, Johan Tibell wrote: > > Here's a rule of thumb: If you have binary data, use Data.ByteString. If you > have text, use Data.Text. Those libraries have benchmarks and have been well > tuned by experienced Haskelleres and should be the fastest and most memory > compa

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Stephen Tetley
The non-type-changing map can be implemented as a type class - in my graphics lib Wumpus, I call it pointwise: class Pointwise sh where type Pt sh :: * pointwise :: (Pt sh -> Pt sh) -> sh -> sh I think other people have posted it to the cafe under a different name, before I did: http://www.

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Stephen Tetley
On 14 August 2010 20:27, Stephen Tetley wrote: > If I was doing Wumpus again though, I'd probably do with Pointwise. Ahem, "do without Pointwise" Originally the types I operated on with Pointwise were more complicated than they are now and Pointwise seemed a benefit. But as I got a better unde

Re: [Haskell-cafe] Question about memory usage

2010-08-14 Thread Tako Schotanus
First of all, thanks to the people who responded :) On Sat, Aug 14, 2010 at 17:49, Christopher Lane Hinson < l...@downstairspeople.org> wrote: > > On Sat, 14 Aug 2010, Tako Schotanus wrote: > > I was reading this article: >> >> >> http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Simon Marlow
On 14/08/10 02:30, Lennart Augustsson wrote: So it's a bug in the garbage collector. It's closing a handle that clearly is still reachable, otherwise this would not have happened. The handle is in fact not reachable from the roots, because the thread that points to it is also not reachable.

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Simon Marlow
On 13/08/10 17:00, Tillmann Rendel wrote: Simon Marlow wrote: Really hClose shouldn't complain about a finalized handle, I'll see if I can fix that. That sounds like a work-around to me, not a fix, because it would not fix more complicated exception handlers. I don't think there's a proble

Re: [Haskell-cafe] Is bumping the version number evil, if it's not mandated by the PVP?

2010-08-14 Thread wren ng thornton
Sebastian Fischer wrote: Hello, I wonder whether (and how) I should increase the version number of a library when the API does not change but the implementation gets more efficient. I think it depends on how much more efficient. Constant factors of improvement are always nice, but they aren

[Haskell-cafe] ANNOUNCE: Darcs hacking sprint (15-17 Oct, Orleans)

2010-08-14 Thread Eric Kow
Hello Haskellers! The Darcs Team will soon be hosting its fifth hacking sprint this October. We would be delighted if you could join us. http://wiki.darcs.net/Sprints/2010-10 Details --- When: 15-17 October 2010 Where: Orleans, France WhoAnybody who wants to hack on Darcs (or Camp, F

[Haskell-cafe] Slightly humorous: Headhunters toolbox (example for Germany)

2010-08-14 Thread Daniel Kahlenberg
Hi list, stumbled across that: http://www.google.com/insights/search/?hl=de#q=haskell&geo=DE&cmpt=q Greetz Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Yitzchak Gale
Lennart Augustsson wrote: >> So it's a bug in the garbage collector.  It's closing a handle that >> clearly is still reachable, otherwise this would not have happened. Simon Marlow wrote: > The handle is in fact not reachable from the roots, because the thread that > points to it is also not reac

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Yitzchak Gale
Sean Leather wrote: > Which one do you use for strings in HTML or XML in which UTF-8 has become > the commonly accepted standard encoding? UTF-8 is only becoming the standard for non-CJK languages. We are told by members of our community in CJK countries that UTF-8 is not widely adopted there, and

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Tillmann Rendel
Simon Marlow wrote: Really hClose shouldn't complain about a finalized handle, I'll see if I can fix that. That sounds like a work-around to me, not a fix, because it would not fix more complicated exception handlers. I don't think there's a problem with more complicated exception handlers.

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Sean Leather
Yitzchak Gale wrote: > Sean Leather wrote: > > Which one do you use for strings in HTML or XML in which UTF-8 has become > > the commonly accepted standard encoding? > > UTF-8 is only becoming the standard for non-CJK languages. > We are told by members of our community in CJK countries > that UTF

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Ben Millwood
On Sat, Aug 14, 2010 at 2:38 AM, michael rice wrote: > > The program below takes a text file and unwraps all lines to 72 columns, but > I'm getting an end of file message at the top of my output. > > How do I lose the EOF? > > Michael > While many other people have shown you why you need not nec

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/14/10 19:07 , Ben Millwood wrote: > Strangely, it prints this before the output of your program - this > isn't terribly important, but for the sake of completeness, it's > because of the different buffering characteristics of stdout and > stderr,

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Yitzchak Gale
Sean Leather wrote: > So then, what is the standard? > ...I also noticeably don't see UTF-16. Right there are a handful of language-specific 16-bit encodings that are popular, from what I understand. > So, if this is the case, then a similar question still arises for CJK text: > What format/libra

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Bryan O'Sullivan
On Sat, Aug 14, 2010 at 3:46 PM, Sean Leather wrote: > > So then, what is the standard? > There isn't one. There are many national standards: - China: GB-2312, GBK and GB18030 - Taiwan: Big5 - Japan: JIS and Shift-JIS (0208 and 0213 variants) and EUC-JP - Korea: KS-X-2001, EUC-KR, a

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread michael rice
Thanks for the caveats. I originally tried to write some pure functions to break up the long strings into ones of acceptable length, to no avail. The solution I submitted was a frustrated attempt to solve the problem *somehow* so I'd have something that worked to refer to. I can see the benefi

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread michael rice
Nope. No redirection. Michael --- On Sat, 8/14/10, Brandon S Allbery KF8NH wrote: From: Brandon S Allbery KF8NH Subject: Re: [Haskell-cafe] Unwrapping long lines in text files To: haskell-cafe@haskell.org Date: Saturday, August 14, 2010, 7:17 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread John Millikin
On Sat, Aug 14, 2010 at 16:38, Bryan O'Sullivan wrote: > In my opinion, this "performance penalty" hand-wringing is mostly silly. > We're talking a pretty small factor of performance difference in most of these > cases. Even the biggest difference, between ByteString and String, is usually > much

[Haskell-cafe] ANN: improve-0.0.8

2010-08-14 Thread Tom Hawkins
ImProve [1] is a imperative programming language for high assurance applications. Using Yices [2], ImProve verifies programs will always adhere to assertion specifications, irrespective of program input. If it is possible for an assertion not to be upheld, ImProve will emit a counter example in t

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Yitzchak Gale
Bryan O'Sullivan wrote: > In general, Unicode uptake is increasing rapidly: > http://googleblog.blogspot.com/2010/01/unicode-nearing-50-of-web.html These Google graphs are the oft-quoted source of Unicode's growing dominance. But the data for those graphs is taken from Google's own web indexing. G

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Bryan O'Sullivan
On Sat, Aug 14, 2010 at 5:11 PM, John Millikin wrote: > > This attitude towards performance, that it doesn't really matter as > long as something happens *eventually*, is what pushed me away from > Python and towards more performant languages like Haskell in the first > place. But wait, wait -

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Bryan O'Sullivan
On Sat, Aug 14, 2010 at 5:39 PM, Yitzchak Gale wrote: > > It could be this really is true for CJK countries as well, > or it could be that the data is skewed by Google's web > indexing methods. I also wouldn't be surprised if the picture for web-based text is quite different from that for other

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread wren ng thornton
Yitzchak Gale wrote: Bryan O'Sullivan wrote: In general, Unicode uptake is increasing rapidly: http://googleblog.blogspot.com/2010/01/unicode-nearing-50-of-web.html These Google graphs are the oft-quoted source of Unicode's growing dominance. But the data for those graphs is taken from Google

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Donn Cave
Quoth "Bryan O'Sullivan" , > In the case of the text library, it is often (but not always) competitive > with bytestring, and I improve it when I can, especially when given test > cases. My goal is for it to be the obvious choice on several fronts: > >- Cleanliness of API, where it's already b

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread John Millikin
On Sat, Aug 14, 2010 at 22:07, Donn Cave wrote: > Am I confused about this?  It's why I can't see Text ever being > simply the obvious choice.  [Char] will continue to be the obvious > choice if you want a functional data type that supports pattern > matching etc.  ByteString will continue to be t

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Edward Z. Yang
Excerpts from John Millikin's message of Sun Aug 15 01:32:51 -0400 2010: > Also, despite the name, ByteString and Text are for separate purposes. > ByteString is an efficient [Word8], Text is an efficient [Char] -- use > ByteString for binary data, and Text for...text. Most mature languages > have

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Michael Snoyman
On Sun, Aug 15, 2010 at 8:39 AM, Edward Z. Yang wrote: > Excerpts from John Millikin's message of Sun Aug 15 01:32:51 -0400 2010: > > Also, despite the name, ByteString and Text are for separate purposes. > > ByteString is an efficient [Word8], Text is an efficient [Char] -- use > > ByteString fo

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread John Millikin
On Sat, Aug 14, 2010 at 22:39, Edward Z. Yang wrote: > Excerpts from John Millikin's message of Sun Aug 15 01:32:51 -0400 2010: >> Also, despite the name, ByteString and Text are for separate purposes. >> ByteString is an efficient [Word8], Text is an efficient [Char] -- use >> ByteString for bina

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread John Millikin
On Sat, Aug 14, 2010 at 22:54, John Millikin wrote: > Haskell: length (pack "\x0001dd1e") Apologies -- this line ought to be: Haskell: Data.Text.length (Data.Text.pack "\x0001dd1e") == 1 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Bryan O'Sullivan
On Sat, Aug 14, 2010 at 10:46 PM, Michael Snoyman wrote: > >> When I'm writing a web app, my code is sitting on a Linux system where the > default encoding is UTF-8, communicating with a database speaking UTF-8, > receiving request bodies in UTF-8 and sending response bodies in UTF-8. So > convert

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Donn Cave
Quoth John Millikin , > I don't see why [Char] is "obvious" -- you'd never use [Word8] for > storing binary data, right? [Char] is popular because it's the default > type for string literals, and due to simple inertia, but when there's > a type based on packed arrays there's no reason to use the l