[Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Sönke Hahn
Hi all! string-conversions is a very simple package to facilitate dealing with different string types. It provides a simple type class that allows you to convert between values of different string types. It also provides type synonyms for these string types. Supported types are: - String -

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2012-03-09 Thread Jerzy Karczmarczuk
John Meacham : The fact that bottom is a value in Haskell is the fundamental thing that differentiates Haskell from other languages and the source of its power. The fact that f _|_ /= _|_ potentially _is_ what it means to be a lazy language. Not treating _|_ as a value would be a huge

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Joachim Breitner
Hi Sönke, Am Freitag, den 09.03.2012, 11:17 +0100 schrieb Sönke Hahn: Any comments welcome. you could elaborate the documenatation “Assumes UTF-8” – I guess this only applies to the two ByteString variants, as String and Text _should_ contain unicode codepoints and no encoding. Not that someone

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Michael Snoyman
On Fri, Mar 9, 2012 at 1:40 PM, Joachim Breitner m...@joachim-breitner.de wrote: Hi Sönke, Am Freitag, den 09.03.2012, 11:17 +0100 schrieb Sönke Hahn: Any comments welcome. you could elaborate the documenatation “Assumes UTF-8” – I guess this only applies to the two ByteString variants, as

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Joachim Breitner
Hi, Am Freitag, den 09.03.2012, 13:44 +0200 schrieb Michael Snoyman: On Fri, Mar 9, 2012 at 1:40 PM, Joachim Breitner m...@joachim-breitner.de wrote: I was about to suggest to merge this into the convertible package (to fight package proliferation), but found that it seems it is already

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Joachim Breitner
Hi, Am Freitag, den 09.03.2012, 13:44 +0200 schrieb Michael Snoyman: On Fri, Mar 9, 2012 at 1:40 PM, Joachim Breitner m...@joachim-breitner.de wrote: I was about to suggest to merge this into the convertible package (to fight package proliferation), but found that it seems it is already

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2012-03-09 Thread Ketil Malde
Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr writes: and the source of it power - if I might cite you - is that we don't see the difference between an object and the process which creates it. Interestingly, according to Wikipedia's article on type system: A type system associates a type

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2012-03-09 Thread Heinrich Apfelmus
Jerzy Karczmarczuk wrote: Well... Personally I hate thinking about bottom as value. I don't do this. I NEVER teach that. And, I am a lazy guy, almost all my Haskell programs are strongly based on laziness. I'll tell you what I teach, and you might throw some tomatoes... The fundamental thing

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Sönke Hahn
Hi Joachim! Joachim Breitner wrote: you could elaborate the documenatation “Assumes UTF-8” – I guess this only applies to the two ByteString variants, as String and Text _should_ contain unicode codepoints and no encoding. Not that someone tries to use a String where each Char corresponds to

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Sönke Hahn
Michael Snoyman wrote: I'm the author of convertible-text, and I consider it deprecated (it's marked as such in the synopsis). As far as string-conversions, I'm a little concerned that it's using decodeUtf8, which can throw exceptions from pure code for invalid UTF8 sequences. I would

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Michael Snoyman
On Fri, Mar 9, 2012 at 4:36 PM, Sönke Hahn sh...@cs.tu-berlin.de wrote: Michael Snoyman wrote: I'm the author of convertible-text, and I consider it deprecated (it's marked as such in the synopsis). As far as string-conversions, I'm a little concerned that it's using decodeUtf8, which can

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.2

2012-03-09 Thread Sönke Hahn
I've uploaded a new version to hackage incorporating suggestions from Joachim Breitner, Michael Snoyman and (offlist) Matthias Fischmann. The package now supplies (), a generic function for string concatenation. (Under ghc = 7.4 this is a re-export from Data.Monoid to avoid name clashes.)

[Haskell-cafe] network-conduit proxy

2012-03-09 Thread grant
I am trying to get a proxy working using the network-conduit package on windows. So I send a request to port 5002 and that gets forwarded to another port 5000 where I have a simple echo server running. I made a stab at it, but get intermittent send errors after the first connection Here is the

[Haskell-cafe] ANNOUNCE: diagrams 0.5

2012-03-09 Thread Brent Yorgey
I am pleased to announce the release of version 0.5 of diagrams [1], a full-featured framework and embedded domain-specific language for declarative drawing. Check out the gallery [2] for examples of what it can do! [1] http://projects.haskell.org/diagrams [2]

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread Alexander V Vershilov
Hello. I'm not expert but first you should not use Network sockets, because everything is included into Data.Conduit.Network, just use high level API. Second, you should use not server inside client but client inside server: so you can make such a code [1]: {-# OPTIONS -Wall #-} import

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread grant
When I run the code you suggested on windows I get the following error: getAddrInfo: does not exist (error 10093) which probably refers to http://trac.haskell.org/network/ticket/32 After adding withSocketsDo I get a little further, but get the following error after sending data through the

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread Alexander V Vershilov
For first error it seems best way will be patching conduit-network as it done it warp [1]. I don't know how to deal with second error. [1] http://hackage.haskell.org/packages/archive/warp/1.1.0.1/doc/html/src/Network-Wai-Handler-Warp.html#runSettings -- Alexander V Vershilov Fri, Mar 09,

[Haskell-cafe] Global Arrays

2012-03-09 Thread Clark Gaebel
In Haskell, what's the canonical way of declaring a top-level array (Data.Vector of a huge list of doubles, in my case)? Performance is key in my case. The straightforward way would just be something like: globalArray :: V.Vector Double globalArray = V.fromList [ huge list of doubles ] {-#

Re: [Haskell-cafe] Global Arrays

2012-03-09 Thread Lyndon Maydwell
Could template-Haskell be used somehow? - Lyndon Maydwell On Mar 10, 2012 4:50 AM, Clark Gaebel cgae...@csclub.uwaterloo.ca wrote: In Haskell, what's the canonical way of declaring a top-level array (Data.Vector of a huge list of doubles, in my case)? Performance is key in my case. The

[Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-09 Thread Paolo Capriotti
I'm pleased to announce the release of version 0.0.1 of pipes-core, a library for efficient, safe and compositional IO, similar in scope to iteratees and conduits. http://hackage.haskell.org/package/pipes-core This is a reimplementation of the original 'Pipe' concept by Gabriel Gonzales. The

Re: [Haskell-cafe] Global Arrays

2012-03-09 Thread John Meacham
On Fri, Mar 9, 2012 at 12:48 PM, Clark Gaebel cgae...@csclub.uwaterloo.ca wrote: static const double globalArray[] = { huge list of doubles }; double* getGlobalArray() { return globalArray; } int        getGlobalArraySize() { return sizeof(globalArray)/sizeof(globalArray[0]); } And importing

Re: [Haskell-cafe] Global Arrays

2012-03-09 Thread Clark Gaebel
What's the advantage of using D.A.Storable over D.Vector? And yes, good call with creating an array of HSDouble directly. I didn't think of that! On Fri, Mar 9, 2012 at 8:25 PM, John Meacham j...@repetae.net wrote: On Fri, Mar 9, 2012 at 12:48 PM, Clark Gaebel cgae...@csclub.uwaterloo.ca wrote:

Re: [Haskell-cafe] Global Arrays

2012-03-09 Thread John Meacham
On Fri, Mar 9, 2012 at 5:49 PM, Clark Gaebel cgae...@csclub.uwaterloo.ca wrote: What's the advantage of using D.A.Storable over D.Vector? And yes, good call with creating an array of HSDouble directly. I didn't think of that! Oh, looks like D.Vector has an unsafeFromForeignPtr too, I didn't

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.0.1

2012-03-09 Thread Mario Blažević
On 12-03-09 07:36 PM, Paolo Capriotti wrote: I'm pleased to announce the release of version 0.0.1 of pipes-core, a library for efficient, safe and compositional IO, similar in scope to iteratees and conduits. I like your design, it seems to strike a good balance between elegance and

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread grant
I've tried running the code with runTCPServer first but I get recv: invalid argument (Bad file descriptor) on ubuntu (virtualbox) and when running on windows I get Network.Socket.ByteString.recv: failed (Unknown error). Also, it seems odd that when I run this code

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread Alexander V Vershilov
As it seems from code runTCPServer registers socket close and TCPClient runs it in bracket so all open resources should be closed. It my last try I add _ - register $ killThread tId after forking serverSrc $$ clientSink, to kill outter thread explicilty otherwise it closes thread with error.

Re: [Haskell-cafe] network-conduit proxy

2012-03-09 Thread grant
Excellent. registering killThread works great. Hopefully the library will be fixed correctly. Thanks a lot for your help, Grant ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Global Arrays

2012-03-09 Thread Alexandr Alexeev
what's the canonical way of declaring a top-level array Did you try State/StateT monads? 10 марта 2012 г. 5:05 пользователь John Meacham j...@repetae.net написал: On Fri, Mar 9, 2012 at 5:49 PM, Clark Gaebel cgae...@csclub.uwaterloo.ca wrote: What's the advantage of using D.A.Storable over