Re: [Haskell-cafe] An interesting paper on VM-friendly GC

2010-10-17 Thread Nathan Howell
On Sat, Oct 16, 2010 at 8:45 AM, Brandon S Allbery KF8NH wrote: > I thought Windows already had a system message for something like that.  Or > at least it used to, although I can see why it would have been removed or at > least deprecated. You're probably thinking of CreateMemoryResourceNotifica

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-17 Thread Donn Cave
[I wrote initially, ...] > As I have migrated more of my application into Haskell, I find that > I/O in one thread effectively blocks other threads. Resolved - the SSL_read external I/O function needs to be "safe". My apologies for botching the mailing list threading, but I deleted the mail wher

Re: [Haskell-cafe] An interesting paper on VM-friendly GC

2010-10-17 Thread Richard O'Keefe
On 16/10/2010, at 10:35 PM, Andrew Coppin wrote: > > Also, it's news to me that Java finds heavy use anywhere yet. (Then again, if > they run Java server-side, how would you tell?) Java seems to be used heavily for developing mobile phone applications (other than iPhone, of course). My young d

[Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Hi Mathew Matthew Brecknell wrote: > Ben Franksen wrote: >> Suppose we have a function >> >> f :: IORef a -> IO b >> >> I want to prove that >> >> f r == do >> s1 <- readIORef r >> r' <- newIORef s1 >> x <- f r' >> s3 <- readIORef r' >> writeIORef r s3 >> return x >

Re: [Haskell-cafe] Re: Text: find

2010-10-17 Thread Luke Palmer
On Sun, Oct 17, 2010 at 4:05 PM, Bryan O'Sullivan wrote: > On Sun, Oct 17, 2010 at 1:51 PM, Antoine Latter wrote: >> >> What would the definition of a function of the form: >> >> > find :: (Text -> Bool) -> Text -> Maybe Text >> >> look like? > > Can you be more specific? I assume you mean that t

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-17 Thread Donn Cave
Quoth Gregory Collins , > Dumb question: are you compiling "-threaded"? Yes. Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Text: find

2010-10-17 Thread Bryan O'Sullivan
On Sun, Oct 17, 2010 at 1:51 PM, Antoine Latter wrote: > > What would the definition of a function of the form: > > > find :: (Text -> Bool) -> Text -> Maybe Text > > look like? > Can you be more specific? I assume you mean that the only sensible return values are Nothing or the entire Text for

Re: [Haskell-cafe] Haskell Front Page Ideas

2010-10-17 Thread Jeremy Shaw
On Sun, Oct 17, 2010 at 3:11 PM, aditya siram wrote: > An honest list of cons mentioned up-front is a great idea and would attract > me to a language. It shows me that the community is grounded, active , > pragmatic and helpful. Yes. It's called "damaging admission", and generally works very well

[Haskell-cafe] Text: find

2010-10-17 Thread Antoine Latter
On Sun, Oct 17, 2010 at 3:25 PM, Bryan O'Sullivan wrote: > On Mon, Oct 11, 2010 at 1:12 PM, Malcolm Wallace > wrote: >> >>  find        find      find           (Text -> Bool) -> Text -> Maybe Text >> >> Proposal: rename Text.findBy to Text.find. > > I agree with the change of type, not so much w

Re: [Haskell-cafe] A rant against the blurb on the Haskell front page

2010-10-17 Thread Jeremy Shaw
On Sat, Oct 16, 2010 at 3:02 AM, Stephen Tetley wrote: > > If a "functional language" doesn't mean anything significant then > Haskell probably isn't the language you should be choosing. People who don't know what 'functional language' means can still get all the benefits of functional programmin

Re: [Haskell-cafe] Haskell Front Page Ideas

2010-10-17 Thread aditya siram
An honest list of cons mentioned up-front is a great idea and would attract me to a language. It shows me that the community is grounded, active , pragmatic and helpful. -deech On Sun, Oct 17, 2010 at 1:45 PM, wrote: > How about a bullet list of Haskell's features (maybe pros & cons) might be

Re: [Haskell-cafe] Re: Strict Core?

2010-10-17 Thread Tom Lokhorst
> Note that in my experience working on SML/NJ's optimizer (using > wrapper+inlining), such an approach to code transformation doesn't care > about types at all, and indeed most/all of what tacc-hs09.pdf presents > is mostly unrelated to whether the language is typed: e.g. the > uncurrying of the z

Re: [Haskell-cafe] Compiling a DSL on the shoulders of GHC

2010-10-17 Thread Patai Gergely
> Not sure how this fits into what I thought you were saying. Are you > trying to use Haskell to build an AST, use GHC to optimize it, and > then spit it out and compile it with, say, a OCaml program that you > have already written? Yes, that would be the basic idea: 1. Compile the Haskell metapr

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-17 Thread Gregory Collins
Donn Cave writes: > As I have migrated more of my application into Haskell, I find that > I/O in one thread effectively blocks other threads. That's rather > the opposite of what I need - I don't care so much if Haskell threads > manage to compute in parallel, but the application should continue

Re: [Haskell-cafe] Compiling a DSL on the shoulders of GHC

2010-10-17 Thread Luke Palmer
On Sun, Oct 17, 2010 at 12:12 PM, Patai Gergely wrote: >> And it is not enough to provide just a driver function, that is called in >> 'main', say >>    run :: IOArrow a b -> a -> IO b >> ? > No, because I need to compile the stream processing program itself by a > different tool. Not sure how th

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Donn Cave
Quoth Jeremy Shaw , ... > I wonder what it would take to make it so that the message body could > be multipart mime... Well, here's what it takes for me - - function to determine file type of attachment (e.g., image/jpeg) - data encoding (base64, maybe quoted-printable, others) - randomly generat

Re: [Haskell-cafe] Re: MonadCatchIO, finally and the error monad

2010-10-17 Thread Antoine Latter
On Sun, Oct 17, 2010 at 1:04 PM, Arie Peterson wrote: > On Thu, 14 Oct 2010 12:01:59 +0200, Michael Snoyman > wrote: >> [...] which I believe is a flawed >> design in the MonadCatchIO-transformers package. Here are my thoughts >> on this and what I think needs to be done to fix it. >> >> [...] >>

[Haskell-cafe] Haskell Front Page Ideas

2010-10-17 Thread caseyh
How about a bullet list of Haskell's features (maybe pros & cons) might be better; followed by a list of a few other languages and their trade-offs. As Jon Bentley has said, "design" is usually trade-offs but when you can come up with something that is a mutual benefit; so much the better

Re: [Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-17 Thread Jeremy Shaw
On Sun, Oct 17, 2010 at 1:32 PM, Stefan Monnier wrote: > AFAIK laziness is a property of the major implementations of Haskell, > but not really of the language itself.  All I see in the Haskell report > points at it being "applicative", "call by name", but nowhere does the > report seem to mandat

Re: [Haskell-cafe] A rant against the blurb on the Haskell front page

2010-10-17 Thread Henning Thielemann
Ketil Malde schrieb: > Don Stewart writes: > >>> Good start, if only the "advanced" were replaced with something more >>> characteristic, like "lazy", or "statically typed". Which, BTW, both do not > >> "lazy" and "statically typed" don't mean much to other people. They are >> buzz words that me

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-17 Thread Stefan Monnier
> Good start, if only the "advanced" were replaced with something more > characteristic, like "lazy", or "statically typed". Which, BTW, both do not > appear in the whole blurb, even though they are *the* characteristics of > Haskell, lazyness being even something that sets it apart from most other

[Haskell-cafe] Re: Strict Core?

2010-10-17 Thread Stefan Monnier
> That said, I've been told that UHC's core language uses the ideas from > Strict Core, and they have/had a student at Utretch (Tom Lokhorst) who > was working on implementing optimisations like arity raising and deep > unboxing for the language. Many/most implementations of ML-ish languages use a

[Haskell-cafe] concurrency vs. I/O in GHC

2010-10-17 Thread Donn Cave
As I have migrated more of my application into Haskell, I find that I/O in one thread effectively blocks other threads. That's rather the opposite of what I need - I don't care so much if Haskell threads manage to compute in parallel, but the application should continue to function, in other threa

Re: [Haskell-cafe] Compiling a DSL on the shoulders of GHC

2010-10-17 Thread Patai Gergely
> And it is not enough to provide just a driver function, that is called in > 'main', say >run :: IOArrow a b -> a -> IO b > ? No, because I need to compile the stream processing program itself by a different tool. I just want to trick GHC into doing much of the weightlifting. No IO monad is i

[Haskell-cafe] Re: MonadCatchIO, finally and the error monad

2010-10-17 Thread Arie Peterson
On Thu, 14 Oct 2010 12:01:59 +0200, Michael Snoyman wrote: > [...] which I believe is a flawed > design in the MonadCatchIO-transformers package. Here are my thoughts > on this and what I think needs to be done to fix it. > > [...] > > Try running the code with each version of go uncommented. In

Re: [Haskell-cafe] Compiling a DSL on the shoulders of GHC

2010-10-17 Thread Henning Thielemann
On Sun, 17 Oct 2010, Patai Gergely wrote: I'm trying to reuse as much of the sweat and tear put into GHC as possible to derive a compiler for a language highly similar to Haskell in many aspects. The difference is that instead of constructing an expression of type IO (), the programmer has to p

[Haskell-cafe] Compiling a DSL on the shoulders of GHC

2010-10-17 Thread Patai Gergely
Hello all, I'm trying to reuse as much of the sweat and tear put into GHC as possible to derive a compiler for a language highly similar to Haskell in many aspects. The difference is that instead of constructing an expression of type IO (), the programmer has to provide a stream processor on the t

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Jeremy Shaw
On Sun, Oct 17, 2010 at 10:14 AM, Michael Snoyman wrote: > I'm sure people would love to see built-in support for serving over > SMTP, but I think that's more appropriate for a different package. > Proper SMTP support will also include SSL/TLS support, which will > require even more dependencies.

[Haskell-cafe] Heterogenous network stream

2010-10-17 Thread Antoine Latter
Forwarding to list. -- Forwarded message -- From: Antoine Latter Date: Sun, Oct 17, 2010 at 10:48 AM Subject: Re: [Haskell-cafe] Heterogenous network stream To: Charles-Pierre Astolfi On Sun, Oct 17, 2010 at 7:31 AM, Charles-Pierre Astolfi wrote: > Hi cafe, > > I'd like to im

Re: [Haskell-cafe] Eta-expansion and existentials (or: types destroy my laziness)

2010-10-17 Thread Roman Leshchinskiy
On 16/10/2010, at 12:36, Max Bolingbroke wrote: > On 16 October 2010 12:16, Roman Leshchinskiy wrote: >> eta :: Stream a -> Stream a >> eta s = Stream s next >> where >> next (Stream s next') = case next' s of >> Just (x,s') -> Just (x,Stream s' next') >>

Re: [Haskell-cafe] UTF-8 problems when decoding JSON data coming from Network.HTTP

2010-10-17 Thread Mark Lentczner
On Oct 17, 2010, at 5:37 AM, Michael Snoyman wrote: > in the case of JSON, I believe this is always specified as UTF-8. RFC 4627 section 3 says that JSON must be encoded in Unicode, but all encodings are acceptable. The encoding is inferred by the firsthand four octets. So you need to be prepar

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Michael Snoyman
OK, I've put together a new repository on github[1]. I've modified the original code from Yesod to now include support for multipart/alternative, and to only create a multipart when there really are multiple parts. I've done some simple tests, and it seems to work just fine. Now a question for ever

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Edward Z. Yang
I'm a bit partial to Swift Mailer [1]. It's useful to support multiple transport backends, especially in situations where sendmail is not portable. Cheers, Edward [1] http://swiftmailer.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:/

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
Something along the lines of these examples would be helpful I think: http://phpmailer.worxware.com/index.php?pg=examples Phpmailer is probably the most widely used email library, so if it could be shown that there was a Haskell equivalent (or better), I think that might start attracting the atte

Re: [Haskell-cafe] UTF-8 problems when decoding JSON data coming from Network.HTTP

2010-10-17 Thread Ionut G. Stan
On 17/Oct/10 3:37 PM, Michael Snoyman wrote: On Sun, Oct 17, 2010 at 2:26 PM, Ionut G. Stan wrote: Thanks Michael, now it works indeed. But I don't understand, is there any inherent problem with Haskell's built-in String? Should one choose ByteString when dealing with Unicode stuff? Or, is ther

Re: [Haskell-cafe] UTF-8 problems when decoding JSON data coming from Network.HTTP

2010-10-17 Thread Michael Snoyman
On Sun, Oct 17, 2010 at 2:26 PM, Ionut G. Stan wrote: > On 17/Oct/10 8:02 AM, Michael Snoyman wrote: >> >> In the gist you sent, the problem is that you are reading the HTTP >> response as a String. The HTTP library doesn't deal well with >> non-Latin characters when doing String requests; you sho

[Haskell-cafe] Heterogenous network stream

2010-10-17 Thread Charles-Pierre Astolfi
Hi cafe, I'd like to implement a toy-protocol and I'm looking for the sanest way (for me) to do so. Here's what it looks like: The server receives, in that order: - Ascii string (4 bytes) - 16 bits int (2 bytes) - 8 bits int (1 byte) - UTF8 string (128 bytes) I tried to use hGetBuf, but I don't

Re: [Haskell-cafe] Proving stuff about IORefs

2010-10-17 Thread Matthew Brecknell
Hi Ben, Ben Franksen wrote: > Suppose we have a function > > f :: IORef a -> IO b > > I want to prove that > > f r == do > s1 <- readIORef r > r' <- newIORef s1 > x <- f r' > s3 <- readIORef r' > writeIORef r s3 > return x I'm not sure where in your question the qua

Re: [Haskell-cafe] UTF-8 problems when decoding JSON data coming from Network.HTTP

2010-10-17 Thread Ionut G. Stan
On 17/Oct/10 8:02 AM, Michael Snoyman wrote: In the gist you sent, the problem is that you are reading the HTTP response as a String. The HTTP library doesn't deal well with non-Latin characters when doing String requests; you should be using ByteString and then converting. It's a little tedious

[Haskell-cafe] Re: Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Ben Millwood wrote: > On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace > wrote: >> >> The problem with the code you originally posted was that it looked like >> this: >> >> f r = do r' <- something >> f r' >> something else -- this is dead code >> >> That is, the computation is non-terminating, b

[Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Derek Elkins wrote: > On Sun, Oct 17, 2010 at 6:49 AM, Miguel Mitrofanov > wrote: >> >> On 17 Oct 2010, at 05:21, Ben Franksen wrote: >> >>> I want to prove that >>> >>> f r == do >>> s1 <- readIORef r >>> r' <- newIORef s1 >>> x <- f r' >>> s3 <- readIORef r' >>> writeIORef r s3 >>> return x >> >

[Haskell-cafe] Re: Opening a gtk2hs link in default browser

2010-10-17 Thread Andy Stewart
Hi Dmitry, Dmitry V'yal writes: > Hello list, > > I'm trying to make a clickable link in gtk2hs program. Clicking it should > open an url in the default > browser. Can I hope to find some portable solution in gtk2hs (it should work > in linux and windows) > or should I start searching platform

Re: [Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Millwood
On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace wrote: > > The problem with the code you originally posted was that it looked like > this: > >  f r = do r' <- something >           f r' >           something else -- this is dead code > > That is, the computation is non-terminating, because f sim

Re: [Haskell-cafe] Systematic treatment of static arguments

2010-10-17 Thread Stephen Tetley
Hi Erik and wren Thanks for both messages. On 17 October 2010 10:12, Erik Hesselink wrote: [Snip] > > I think you can just use the original instance for Monoid for this. It > declares > > instance Monoid b => Monoid a -> b > > since 'b' can itself be a function (and r1 -> r2 -> a is parenthesiz

Re: [Haskell-cafe] Proving stuff about IORefs

2010-10-17 Thread Derek Elkins
On Sun, Oct 17, 2010 at 6:49 AM, Miguel Mitrofanov wrote: > > On 17 Oct 2010, at 05:21, Ben Franksen wrote: > >> I want to prove that >> >>  f r == do >>    s1 <- readIORef r >>    r' <- newIORef s1 >>    x <- f r' >>    s3 <- readIORef r' >>    writeIORef r s3 >>    return x > > That is not true.

Re: [Haskell-cafe] Proving stuff about IORefs

2010-10-17 Thread Miguel Mitrofanov
On 17 Oct 2010, at 05:21, Ben Franksen wrote: > I want to prove that > > f r == do >s1 <- readIORef r >r' <- newIORef s1 >x <- f r' >s3 <- readIORef r' >writeIORef r s3 >return x That is not true. Consider the following function: g r1 r2 = writeIORef r1 0 >> writeIORef

Re: [Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Malcolm Wallace
At any rate, if you intend to prove this for any arbitrary f, I can't tell you how to prove it formally because it's not true. How do you know that? Can you give an example where it fails? The problem with the code you originally posted was that it looked like this: f r = do r' <- some

[Haskell-cafe] Opening a gtk2hs link in default browser

2010-10-17 Thread Dmitry V'yal
Hello list, I'm trying to make a clickable link in gtk2hs program. Clicking it should open an url in the default browser. Can I hope to find some portable solution in gtk2hs (it should work in linux and windows) or should I start searching platform specific ones, like /usr/bin/xdg-open or som

Re: [Haskell-cafe] Text.Regex Segfault

2010-10-17 Thread Christopher Done
On 17 October 2010 04:45, Duane Johnson wrote: > I bumped into a segmentation fault in the regex library today and thought > I'd warn others in case similar behavior is observed: > >> Prelude> :m Text.Regex >> Prelude Text.Regex> map read (splitRegex (mkRegex "\\|") "0|1|2|4") :: >> [Int] >> Loadi

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Robert Wills
Yes you're right Kevin. I'll put up a new release sometime in the next week with some more examples and possible some simpler methods if only so HaskellNet can be more easily evaluated. As I recall Happstack also uses an smtp library. I forget which one. -Rob On Sun, Oct 17, 2010 at 9:29 AM, K

Re: [Haskell-cafe] Systematic treatment of static arguments

2010-10-17 Thread Erik Hesselink
On Sat, Oct 16, 2010 at 21:39, Stephen Tetley wrote: > Hello list > > The Monad and Applicative instances for functions are "equivalent" to > the respective Reader vesions (I use "equivalent" along the lines of - > operationally the same but without the type distinction / newtype). > There is also

Re: [Haskell-cafe] ghci - always show types

2010-10-17 Thread Gaius Hammond
On 13 Oct 2010, at 16:55, Ozgur Akgun wrote: Cafe, Just a quick question. Either I am hallucinating or there was a way of saying ghci to always show types. It was working as if you typed ":t it" after every line of input. Sorry, I searched but couldn't find the option via google. Hope

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
Hi Robert, I did look at HaskellNet a few months ago. It looked big and undocumented so I guess I got scared away. What I'd be interested in is something with the simplicity of the PHP mail command (or perhaps the phpmailer package). I dislike PHP as a programming language but it does basic web

Re: [Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Robert Wills
Last summer I put cabalized HaskellNet (written by Jun Mukai for a GSOC) (http://hackage.haskell.org/package/HaskellNet) and uploaded it to hackage. I put myself down as a maintainer but I haven't done much maintaining. HaskellNet also does multipart mime and base64 stuff as well as imap and pop

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
Hi Michael, Last time I checked Hackage for email libraries I could find some basic SMTP systems but nothing very recent or robust. Practically every web app needs to send email, so I think that a robust and well maintained email package would be very useful. I know you have many other projects