Re: [Haskell-cafe] Why monoids will abide...

2009-01-20 Thread minh thu
2009/1/21 Don Stewart : > http://apfelmus.nfshost.com/monoid-fingertree.html > > Thanks Apfelmus for this inspiring contribution! > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > And fo

[Haskell-cafe] ANN: HTTP-4000.0.4 released

2009-01-20 Thread Sigbjorn Finne
Hi, a new release of HTTP, version 4000.0.4, is now available http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP It is also pointed at via the updated HTTP web page -- http://projects.haskell.org/http/ The main change is the addition of registering a Browser event handler for

Re: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-20 Thread Sigbjorn Finne
On 1/17/2009 08:21, Tim Newsham wrote: There's however still no framework which supports both HTTP client and server functions using the same Request and Response data type, right? I don't know whether I am the only one who needs this (e.g. for the Real Monad Transformer). E.g. a proxy would need

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Aaron Tomb
On Jan 20, 2009, at 7:35 PM, wren ng thornton wrote: Jim Burton wrote: Hi, I will be a TA on a comparative PL course and I'm looking for small examples (ammunition) which motivate the use of Haskell and functional programming generally. The course is for 1st year Software Engineers, none of wh

Re: [Haskell-cafe] Quite confused by simple transformations on this code not working

2009-01-20 Thread Alexander Dunlap
Instead of declaring (/\) :: Eq a => Sentence a -> Sentence a -> Sentence a, you could say (/\) :: Eq a -> [a] -> [a] -> [a]. Then it would work in both places. ([a] -> [a] -> [a] is a more general type than [[Term a]] -> [[Term a]] -> [[Term a]], so functions with the former type can be used in pl

Re: [Haskell-cafe] Quite confused by simple transformations on this code not working

2009-01-20 Thread Andrew Wagner
So...there's just no good way to avoid the duplication? On Tue, Jan 20, 2009 at 11:10 PM, wren ng thornton wrote: > Andrew Wagner wrote: > >> Strange little bit of code: >> http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=829#a829 >> >> If I do any of the following, all of which seem natural

Re: [Haskell-cafe] Quite confused by simple transformations on this code not working

2009-01-20 Thread wren ng thornton
Andrew Wagner wrote: Strange little bit of code: http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=829#a829 If I do any of the following, all of which seem natural to me, it fails to typecheck: 1. move f out of the 'where' clause (with or without a type signature) 2. put the same type

[Haskell-cafe] Quite confused by simple transformations on this code not working

2009-01-20 Thread Andrew Wagner
Strange little bit of code: http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=829#a829 If I do any of the following, all of which seem natural to me, it fails to typecheck: 1. move f out of the 'where' clause (with or without a type signature) 2. put the same type signature on f as is o

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread wren ng thornton
Jim Burton wrote: Hi, I will be a TA on a comparative PL course and I'm looking for small examples (ammunition) which motivate the use of Haskell and functional programming generally. The course is for 1st year Software Engineers, none of whom are likely to have used a functional language. They w

[Haskell-cafe] Re: Why monoids will abide...

2009-01-20 Thread Andrzej Jaworski
Monads are monoids in categories of functors C -> C Arrows are monoids in subcategories of bifunctors (C^op) x C -> C Trees are a playing ground for functors in general:-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-20 Thread George Pollard
On Wed, 2009-01-14 at 15:59 +0100, Manlio Perillo wrote: > 1) In a Python string it is available the \U{name} escape, where name is > a character name in the Unicode database. > > As an example: > foo = u"abc\N{VULGAR FRACTION ONE HALF}" This is possible via QuasiQuotation, you ca

Re: [Haskell-cafe] Factoring into type classes

2009-01-20 Thread wren ng thornton
Patai Gergely wrote: Hi everyone, I have a general program design question, but I can't really think of good examples so it will be a bit vague. There was a discussion on Show not long ago which brought up the problem that there are several ways to "show" a data structure, and it depends on the

Re: [Haskell-cafe] Factoring into type classes

2009-01-20 Thread wren ng thornton
Luke Palmer wrote: On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely wrote: However, there are other type classes that are too general to assign such concrete uses to. For instance, if a data structure can have more than one meaningful (and useful) Functor or Monoid instance, As a side curiosit

Re: [Haskell-cafe] Re: How to make code least strict?

2009-01-20 Thread Conal Elliott
Lovely reformulation, Ryan! I think lub [4] is sufficient typeclass hackery for unambPatterns: unambPatterns == lubs == foldr lub undefined [4] http://conal.net/blog/posts/merging-partial-values I think performance is okay now, if you have very recent versions of unamb *and* GHC head (contai

Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Lennart Augustsson
There's the numbers package which contains BigFloat. You can pick your own precision, but it's not IEEE. It's actually base 10 floats which makes it more fun (actually, the iEEE standard will cover base 10 floats in the future). -- Lennart On Wed, Jan 21, 2009 at 12:44 AM, Tim Chevalier wrote

Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Tim Chevalier
On 1/20/09, Lennart Augustsson wrote: > Do you have Integer? > Yes (with the integer-simple library -- I was hoping there was some analogue of integer-simple for Float, although Don didn't think there was one). -t -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "Havi

Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Lennart Augustsson
Do you have Integer? On Wed, Jan 21, 2009 at 12:23 AM, Tim Chevalier wrote: > On 1/20/09, Don Stewart wrote: >> catamorphism: >> >> > Hello, >> > Is there a pure Haskell implementation of Floats, i.e., one that >> > (unlike GHC.Float) doesn't use foreign calls for things like >> > isFloatNega

[Haskell-cafe] Why monoids will abide...

2009-01-20 Thread Don Stewart
http://apfelmus.nfshost.com/monoid-fingertree.html Thanks Apfelmus for this inspiring contribution! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Tim Chevalier
On 1/20/09, Don Stewart wrote: > catamorphism: > > > Hello, > > Is there a pure Haskell implementation of Floats, i.e., one that > > (unlike GHC.Float) doesn't use foreign calls for things like > > isFloatNegativeZero? I don't care about performance; I'm just looking > > for something that doe

Re: [Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Don Stewart
catamorphism: > Hello, > Is there a pure Haskell implementation of Floats, i.e., one that > (unlike GHC.Float) doesn't use foreign calls for things like > isFloatNegativeZero? I don't care about performance; I'm just looking > for something that doesn't use foreign calls. > Huh, what's the use ca

[Haskell-cafe] Pure Haskell implementation of Float type?

2009-01-20 Thread Tim Chevalier
Hello, Is there a pure Haskell implementation of Floats, i.e., one that (unlike GHC.Float) doesn't use foreign calls for things like isFloatNegativeZero? I don't care about performance; I'm just looking for something that doesn't use foreign calls. Thanks, Tim -- Tim Chevalier * http://cs.pdx.ed

[Haskell-cafe] Another Windows question - reading the output from a process

2009-01-20 Thread Günther Schmidt
Hi all, I'm using WinXP with 6.8.3. For some reason the windows version of 6.8.3 ships with a somewhat "castrated" version of package process, one that does not contain "readProcess" among other convenient functions. Is there a way to install the fully fledged version of "process", because

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
At Tue, 20 Jan 2009 14:17:10 -0800, Ryan Ingram wrote: > > I recommend checking out Don Syme's slides from CUFP 2008. > > http://cufp.galois.com/2008/slides/ > > This isn't Haskell directly, it's F#, but it fits the "functional > programming generally", and the two languages have, relative to th

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
At Tue, 20 Jan 2009 22:08:55 +0100, Henning Thielemann wrote: > > Jim Burton schrieb: > > > Well, I might but they definitely do not :-) We are talking about some > > maths-averse people and you would not have got to the final syllable > > of 'fibonacci' before all hope was lost. But I am sure th

Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-20 Thread Henning Thielemann
rocon...@theorem.ca schrieb: > On Sun, 18 Jan 2009, Ross Paterson wrote: > >> Anyone can check out the darcs repos for the libraries, and post >> suggested improvements to the documentation to librar...@haskell.org >> (though you have to subscribe). It doesn't even have to be a patch. >> >> Sure,

Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Henning Thielemann
Apfelmus, Heinrich schrieb: > Obviously, those who know what a monoid is have already invested years > of time practicing mathematics while those that even attack the name > "monoid" clearly lack this practice. It's like peano virtuosoes compared > to beginning keyboard pressers. Aren't all Haske

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Jonathan Cast
On Tue, 2009-01-20 at 23:41 +0100, Henning Thielemann wrote: > On Thu, 15 Jan 2009, John Goerzen wrote: > > > One thing that does annoy me about Haskell- naming. Say you've > > noticed a common pattern, a lot of data structures are similar to > > the difference list I described above, in that t

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Henning Thielemann
John Goerzen schrieb: > Though if all we're talking about is naming, I would still maintain that > newbie-friendly naming is a win. We can always say "HEY MATHEMETICIANS: > APPENDABLE MEANS MONOID" in the haddock docs ;-) We already have a problem with this: Haskell 98 uses intuitive names for t

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Henning Thielemann
On Thu, 15 Jan 2009, John Goerzen wrote: One thing that does annoy me about Haskell- naming. Say you've noticed a common pattern, a lot of data structures are similar to the difference list I described above, in that they have an empty state and the ability to append things onto the end. No

[Haskell-cafe] Type family problem

2009-01-20 Thread Sjoerd Visscher
Hi all, When I try this bit of code: > class C1 a where > type F a :: * > x :: F a > y :: F a > x = y I get this error: Couldn't match expected type `F a1' against inferred type `F a' In the expression: y In the definition of `x': x = y I can't figure out what is going on

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Ryan Ingram
I recommend checking out Don Syme's slides from CUFP 2008. http://cufp.galois.com/2008/slides/ This isn't Haskell directly, it's F#, but it fits the "functional programming generally", and the two languages have, relative to the universe of programming languages, more in common than they do diffe

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Henning Thielemann
Jim Burton schrieb: > Well, I might but they definitely do not :-) We are talking about some > maths-averse people and you would not have got to the final syllable > of 'fibonacci' before all hope was lost. But I am sure there are > plenty of examples that rely on laziness which will communicate.

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread Luke Palmer
On Tue, Jan 20, 2009 at 1:14 PM, David Menendez wrote: > On Tue, Jan 20, 2009 at 2:51 PM, Mauricio wrote: > >>> But how is this: > >>> data SomeNum = forall a. SN a > >>> different from: > >>> data SomeNum = SN (forall a. a) > > > >> At a glance they look the same to me — but only the first is a

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
At Tue, 20 Jan 2009 12:25:00 -0800, Dan Weston wrote: > Hi Dan, > One of the coolest things about Haskell is the ability to refer to > values not yet calculated, without having to work out the timing yourself. > > You want Fibonacci numbers? > Well, I might but they definitely do not :-) We

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Dan Weston
One of the coolest things about Haskell is the ability to refer to values not yet calculated, without having to work out the timing yourself. You want Fibonacci numbers? Prelude> let z = zipWith (+) (0:1:z) (0:z) in take 10 z [0,1,1,2,3,5,8,13,21,34] Try doing that in one line of C++. See als

Re: [Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread David Menendez
On Tue, Jan 20, 2009 at 2:51 PM, Mauricio wrote: >>> But how is this: >>> data SomeNum = forall a. SN a >>> different from: >>> data SomeNum = SN (forall a. a) > >> At a glance they look the same to me — but only the first is accepted by >> ghc. > > Following the link you pointed in the last > mes

Re: [Haskell-cafe] Employment

2009-01-20 Thread Creighton Hogg
On Tue, Jan 20, 2009 at 1:50 PM, Paul Johnson wrote: > Tom Hawkins wrote: >> >> Such a database would help me counter by boss's >> argument that "it's impossible to find and hire Haskell programmers." >> >> > > There was a thread last week where someone asked who would be interested in > a hypoth

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread Mauricio
But how is this: data SomeNum = forall a. SN a different from: data SomeNum = SN (forall a. a) At a glance they look the same to me — but only the first is accepted by ghc. Following the link you pointed in the last message, I found this at 8.8.4.1: data T a = T1 (forall b. b -> b -> b) a I

Re: [Haskell-cafe] Employment

2009-01-20 Thread Paul Johnson
Tom Hawkins wrote: Such a database would help me counter by boss's argument that "it's impossible to find and hire Haskell programmers." There was a thread last week where someone asked who would be interested in a hypothetical Haskell job. He got about 20 positive responses. This agrees

Re: [Haskell-cafe] Factoring into type classes

2009-01-20 Thread Iavor Diatchki
Hello, I don't mean to be negative here but I really fail to see how do any of these ideas help the situation. (I do think it would be cool to have a generic way to lift functions from one type to another that is isomorphic to it). The fundamental problem is that there are multiple functions of t

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-20 Thread Mauro J. Jaskelioff
Ross Paterson wrote: > On Mon, Jan 19, 2009 at 01:13:37PM -0800, Jonathan Cast wrote: > >> (On the other hand, your hunch that lift = return is correct --- so you >> get a cookie for that; it's just that return here is neither the return >> of the monad for m nor the return of the monad for Read

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread ChrisK
Great, thanks! I'm enlightened :) And no one had to hit you with a stick first! But how is this: data SomeNum = forall a. SN a different from: data SomeNum = SN (forall a. a) ? At a glance they look the same to me — but only the first is accepted by ghc. There is also the GADT syntax:

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Tristan Seligmann
* Andrew Coppin [2009-01-16 22:20:35 +]: > A problem I see a lot of [and other people have mentioned this] is that > a lot of documentation presents highly abstracted things, and gives *no > hint* of why on earth these might possibly be useful for something. I think this is definitely

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Tristan Seligmann
* John Goerzen [2009-01-15 10:15:36 -0600]: > If you're learning Haskell, which communicates the idea more clearly: > > * Appendable > > or > > * Monoid > > I can immediately figure out what the first one means. I think that's deceptively misleading. Sure, list1 `mappend` list2 is concaten

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread Gleb Alexeyev
I just thought that the shorter explanation could do better: the difference is in the types of the constructor functions. Code: > {-# LANGUAGE ExistentialQuantification #-} > {-# LANGUAGE RankNTypes #-} > data SomeNum1 = forall a. SN1 a > data SomeNum2 = SN2 (forall a. a) ghci session: *Main> :

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread Gleb Alexeyev
Mauricio wrote: But how is this: data SomeNum = forall a. SN a different from: data SomeNum = SN (forall a. a) In the first case the constructor SN can be applied to the monomorphic value of any type, it effectively hides the type of the argument. For example, you can have a list like [S

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes (actually, components...)

2009-01-20 Thread Mauricio
4294967296 :: Integer (...) In the above you can see the polymorphism of the return type of fromInteger, it returns a Int8 or a Int32. You can see the polymorphism of the argument of "show", it takes an Int8 or Int32 or Integer. The latest ghc-6.10.1 also allows avoiding use of SomeNum, see

Re: [Haskell-cafe] Factoring into type classes

2009-01-20 Thread Conor McBride
Hi folks I have been known to venture the viewpoint that the "newtype trick" might benefit from improved library support, for example, here http://www.mail-archive.com/haskell-cafe@haskell.org/msg37213.html This is in a similar vein to Derek's approach, if accompanied by a little more grotesq

[Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Heinrich Apfelmus
Lennart Augustsson wrote: > A very nice writeup about the use of monoid with finger tree. Thanks :) > But please, use the names of the monoid operations that the rest of > the Haskell libraries use. > By using different names you are just confusing readers (even if you > don't like the standard n

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
Jim Burton wrote: > > > Adrian Neumann wrote: >> There was a thread about that: >> >> > http://www.haskell.org/pipermail/haskell-cafe/2007-September/ >> 031402.html > > Thanks! I didn't literally mean "elevator pitch" and if I knew that thread > existed would have phrased my post differently,

Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Dougal Stanton
On Tue, Jan 20, 2009 at 3:42 PM, Heinrich Apfelmus wrote: > Let me explain this monoid magic, albeit not in this message which would > become far too long, but at > > http://apfelmus.nfshost.com/monoid-fingertree.html > That is a very nice summary! I did my own investigation of fingertrees rece

Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Lennart Augustsson
A very nice writeup about the use of monoid with finger tree. But please, use the names of the monoid operations that the rest of the Haskell libraries use. By using different names you are just confusing readers (even if you don't like the standard names). Also, you can replace Infinity by maxBou

[Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-20 Thread Heinrich Apfelmus
david48 wrote: > On the other hand, on page 320 there is a nice explanation of Monoid, > and on page 380, which isn't mentionned in the index, there might be > the first time one can understand why the writer monad works with > monoids instead of lists: to be able to use better suited data types >

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-20 Thread Lennart Augustsson
Yes, the Agda modules remind me of Cayenne. :) On Tue, Jan 20, 2009 at 12:54 PM, Bas van Dijk wrote: > On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo > wrote: >> 2) In Python it is possible to import modules inside a function. >> >> In Haskell something like: >> >> joinPath' root name = >>

Re: [Haskell-cafe] Employment

2009-01-20 Thread Jason Dusek
At my former employer, I wrote a couple of internal tools in Haskell that shipped to Linux, OS X and Windows. The relative ease of binary preparation was a selling point of Haskell. -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
Adrian Neumann wrote: > There was a thread about that: > > > http://www.haskell.org/pipermail/haskell-cafe/2007-September/ > 031402.html Thanks! I didn't literally mean "elevator pitch" and if I knew that thread existed would have phrased my post differently, because a list of the things that ar

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes

2009-01-20 Thread ChrisK
Mauricio wrote: Hi, I'm trying, without success, to understand the difference between existencial quantification and polymorphic datatypes. Can you give me a hint, or an example where one is valid and the other is not? The first thing to ensure you know is that Haskell can have functions (usua

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-20 Thread Bas van Dijk
On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo wrote: > 2) In Python it is possible to import modules inside a function. > > In Haskell something like: > > joinPath' root name = > joinPath [root, name] > importing System.FilePath (joinPath) I just like to point out the dependentl

Re: [Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Adrian Neumann
There was a thread about that: > http://www.haskell.org/pipermail/haskell-cafe/2007-September/ 031402.html Am 20.01.2009 um 11:07 schrieb Jim Burton: Hi, I will be a TA on a comparative PL course and I'm looking for small examples (ammunition) which motivate the use of Haskell and functional

[Haskell-cafe] Re: Existencial quantification and polymorphic datatypes

2009-01-20 Thread Jon Fairbairn
Mauricio writes: > I'm trying, without success, to understand the difference > between existencial quantification and polymorphic > datatypes. Polymorphic types are universally quantified; so id:: forall t. t -> t means that id works for every type t. If haskell had a symbol for existential q

Re: [Haskell-cafe] Existencial quantification and polymorphic datatypes

2009-01-20 Thread Lennart Augustsson
Do you mean difference between data A a = A a and data B = B a -- leaving out the forall ? On Tue, Jan 20, 2009 at 10:02 AM, Mauricio wrote: > Hi, > > I'm trying, without success, to understand the difference > between existencial quantification and polymorphic > datatypes. Can yo

Re: [Haskell-cafe] Cabal dependencies

2009-01-20 Thread Duncan Coutts
On Thu, 2009-01-15 at 18:38 -0500, Stephen Hicks wrote: > Hi, > > I'm having some difficulty specifying dependencies in my .cabal file > for a package I'm looking to upload to hackage soon. The difficulty > is as follows. I basically want to specify > parsec (>= 2.1 && < 3.0.0) || (> 3.0.0 &&

[Haskell-cafe] Re: GHCi Memory Leak in Windows Vista

2009-01-20 Thread Gracjan Polak
Same here: Vista, GHC 6.8.3 Tested a bit changed scenario: instead of 20 separate compilations it is worthwhile to run single, longer build, e.g. ghc --make of same package. Seems like GHCi does not run garbage collection when machine is busy. And then it accumulates memory. This renders Vista

[Haskell-cafe] Elevator pitch for functional programming

2009-01-20 Thread Jim Burton
Hi, I will be a TA on a comparative PL course and I'm looking for small examples (ammunition) which motivate the use of Haskell and functional programming generally. The course is for 1st year Software Engineers, none of whom are likely to have used a functional language. They will all have experie

[Haskell-cafe] Existencial quantification and polymorphic datatypes

2009-01-20 Thread Mauricio
Hi, I'm trying, without success, to understand the difference between existencial quantification and polymorphic datatypes. Can you give me a hint, or an example where one is valid and the other is not? Thanks, Maurício ___ Haskell-Cafe mailing list H

Re: [Haskell-cafe] xhtml + bytestring

2009-01-20 Thread Eugene Kirpichov
Hi, I improved the implementation of concatMap: concatMap' :: (Word8 -> L.ByteString) -> L.ByteString -> L.ByteString concatMap' f s = L.unfoldr p x0 where x0 = (LI.Empty, s) p (sf, s) = case L.uncons sf of Just (c,sf') -> Just (c, (sf',s)) Nothing -> case