[Haskell-cafe] Understanding Iteratees

2010-10-27 Thread Arnaud Bailly
Hello,
I am trying to wrap my head around the concept of Iteratee reading the
article by John Lato in Monad Reader issue 16
(http://themonadreader.files.wordpress.com/2010/05/issue16.pdf). I
followed the "advice" on page 34:

"I have frequently heard reports from Haskellers (including highly-talented and
experienced users) that the only way they could understand enumeration-based
I/O was by re-implementing it themselves."

and so reimplemented this code in Java which is, for better and worse,
my current professional language (and there really is no point in
writing my own 50th iteratee code...).

I have a question about iteratees composition and their behaviour. I
tried to use the throbber code to display progress while writing a
file, without using enumeratees which are introduced later on in the
article, but failed. I can bind the two iteratees together, but the
writer iteratee consumes the stream of characters to write before
handing over the control to the throbber iteratee which has nothing to
count. Did I miss something ?

Thanks in advance,
Arnaud
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Stephen Tetley
Hi Ivan

You're free to do what you want in your own package, but...


Having a Pretty class plus primitive printers int, bool is an
advantage. For ints, bools, ... code tends to look neater if you use
int or bool rather than pretty. Plus for ints and others you tend to
need things like hex printers anyway, so one size via a type class
doesn't fit all. As for the class - if I have a reasonably sized
syntax tree I'd rather just do

> pretty a

... than formulate a naming scheme like:

> prettyExpr a

Regards

Stephen
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] In what language...?

2010-10-27 Thread Stephen Tetley
On 27 October 2010 00:21, Richard O'Keefe  wrote:

> Here's the table of contents of a typical 1st year discrete mathematics book,
> selected and edited:
>        - algorithms on integers
>        - sets
>        - functions
>        - relations
>        - sequences
>        - propositional logic
>        - predicate calculus
>        - proof
>        ...

Quite a bit of this is covered by "Discrete Mathematics Using a
Computer" by John O'Donnell, Cordelia Hall and Rex Page (Springer).
Haskell is the implementation language, so effectively it is "Discrete
Mathematics Using Haskell".

It would be nice if someone wrote a geometry book using Haskell...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Ivan Lazar Miljenovic
On 27 October 2010 18:39, Stephen Tetley  wrote:
> Having a Pretty class plus primitive printers int, bool is an
> advantage. For ints, bools, ... code tends to look neater if you use
> int or bool rather than pretty. Plus for ints and others you tend to
> need things like hex printers anyway, so one size via a type class
> doesn't fit all.

Definitely agreed.

> As for the class - if I have a reasonably sized
> syntax tree I'd rather just do
>
>> pretty a
>
> ... than formulate a naming scheme like:
>
>> prettyExpr a

What do you mean by "prettyExpr"?

My main objection to having a Pretty type class is that when having a
"reasonably sized syntax tree", aren't you likely to want to have your
own custom printing variants rather than the ones in the pre-defined
class?  As such, does having a default class make sense if it isn't
used?

That said, 9 packages [1] do use prettyclass [2]... out of the 168
packages [3] that use pretty itself [4] (some of which implement their
own Pretty class).

[1]: 
http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/prettyclass-1.0.0.0#direct
[2]: http://hackage.haskell.org/package/prettyclass
[3]: 
http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/pretty-1.0.1.1#direct
[4]: http://hackage.haskell.org/package/pretty

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Does it deserve to be a hackage package?

2010-10-27 Thread Dmitry V'yal

Hello haskellers,

While ago I had a question about opening the url in the default browser 
from haskell program. I didn't get any immediate answers so I wrote my 
own solution. On Linux it uses xdg-open and on Windows - ShellExecute Api.


Later I received a letter saying what similar functionality was recently 
implemented in trunk version of gtk2hs but is currently unavailable as 
binary package.


Code I wrote works quite well for my purposes and I copied it into 
several my programs. In order to make maintenance easier I recently 
thought about uploading it to hackage. But given a wast amount of 
half-dead packages with intersecting functionality there I'd like to ask 
the opinion of community. Does such library look helpful to you?


Dmitry
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Stephen Tetley
On 27 October 2010 08:57, Ivan Lazar Miljenovic
 wrote:

>
> What do you mean by "prettyExpr"?

Without a type class I generally name pretty printers by the pretty
'pretty' then the type they print Expr (expression), Decl
(declaration) etc.

> My main objection to having a Pretty type class is that when having a
> "reasonably sized syntax tree", aren't you likely to want to have your
> own custom printing variants rather than the ones in the pre-defined
> class?  As such, does having a default class make sense if it isn't
> used?
>
> That said, 9 packages [1] do use prettyclass [2]... out of the 168
> packages [3] that use pretty itself [4] (some of which implement their
> own Pretty class).

For a syntax tree I'd want a class, then I can use pretty at any
level. This is helpful in defining the instances as most of the work
is delegated to pretty rather than prettyExp, prettyDecl etc. so it
keeps the code neat. It is also useful in GHCi where I can just call
pretty on something.

I can't think that I've ever wanted two different flavours of output
for a syntax tree. If I was wanted 'round trip printing' (from parsing
to pretty to parsing) I'd have to take a lot of care over white space
and layout so I would be needing something more powerful than a pretty
printer.


As for the prettyclass in HughesPJ, if people found they wanted this I
don't know why people didn't switch to wl-pprint. Wl-pprint is nicer
in enough ways to make the change sensible.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Ivan Lazar Miljenovic
On 27 October 2010 19:19, Stephen Tetley  wrote:
> On 27 October 2010 08:57, Ivan Lazar Miljenovic
>  wrote:
>> My main objection to having a Pretty type class is that when having a
>> "reasonably sized syntax tree", aren't you likely to want to have your
>> own custom printing variants rather than the ones in the pre-defined
>> class?  As such, does having a default class make sense if it isn't
>> used?
>>
>> That said, 9 packages [1] do use prettyclass [2]... out of the 168
>> packages [3] that use pretty itself [4] (some of which implement their
>> own Pretty class).
>
> For a syntax tree I'd want a class, then I can use pretty at any
> level. This is helpful in defining the instances as most of the work
> is delegated to pretty rather than prettyExp, prettyDecl etc. so it
> keeps the code neat. It is also useful in GHCi where I can just call
> pretty on something.

Why not write your own Pretty class for that project then?

Admittedly, some packages might write their own class because they
didn't want to use non-ghc/platform libraries or prettyclass didn't
exist then.

I had to write my own [1] for two reasons: 1) I needed to be able to
differentiate between quoted and un-quoted values, and 2) some of the
ways values get pretty-printed are different than just "text . show",
which is what all the default instances of the Pretty classes are
(with the exception of String).  It's this second point that I would
wonder how many people would use a default Pretty class: just because
I want to print String values one way, does that you mean you should
print them that way as well?

[1]: 
http://hackage.haskell.org/packages/archive/graphviz/2999.10.0.1/doc/html/Data-GraphViz-Printing.html#t:PrintDot

> I can't think that I've ever wanted two different flavours of output
> for a syntax tree. If I was wanted 'round trip printing' (from parsing
> to pretty to parsing) I'd have to take a lot of care over white space
> and layout so I would be needing something more powerful than a pretty
> printer.

Again, it's not a matter of two different types of output; it's a
matter of my way of doing output differs from your way of doing
output, even for in-built types.  Don't forget, instances are imported
and exported implicitly.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Does it deserve to be a hackage package?

2010-10-27 Thread Christopher Done
On 27 October 2010 10:13, Dmitry V'yal  wrote:
> While ago I had a question about opening the url in the default browser from
> haskell program. I didn't get any immediate answers so I wrote my own
> solution. On Linux it uses xdg-open and on Windows - ShellExecute Api.

> Does it deserve to be a hackage package?

If it's not in an existing small library, yes. If I have to have a
dependency on gtk2hs just to do that, I'd rather have a small library.
Does it work on OS X? If not, I'm sure someone would submit a patch
for that. This can also be used for opening the file browser and such,
right?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Help me TH code.

2010-10-27 Thread Jonas Almström Duregård
Unless you have a 'real' type for parse sometime during compile time, TH
won't be able to generate it. A good rule of thumbs is that if you can't
write the code yourself, then you can't get TH to do it either.

/J

On 27 October 2010 08:50, Andy Stewart  wrote:

> Serguey Zefirov  writes:
>
> > 2010/10/27 Andy Stewart :
> >> Hi all,
> >>
> >> I want use TH write some function like below:
> >>
> >>  data DataType = StringT
> >>| IntT
> >>| CharT
> >>
> >>  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN)
> >>
> >> Example:
> >>
> >>  parse [("string", StringT), ("001", IntT), ("c", CharT)]
> >>
> >> will return:
> >>
> >>  ("string", 001, 'c')
> >>
> >> So how to use TH write 'parse' function?
> >
> > I think that you should use TH properly, without compiler and logical
> errors.
> >
> > What actually do you want?
> I'm build multi-processes communication program.
>
> Example i have two processes : Client and Server.
>
> At Client side, i pass [DataType] to Server, example:
>
>  [StringT, IntT, CharT]
>
> Server will handle "user input" with [DataType]
> and return result [String] to Client side, example:
>
>  ["string", "001", "c"]
>
> Then at Client side, i need parse [String] to get real value:
>
>  ("string", 001, 'c')
>
> Because, [DataType] have many different case, so i want pass [String]
> between processes, and use TH parse result [String] at Client side.
>
> Thanks,
>
>  -- Andy
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Help me TH code.

2010-10-27 Thread Serguey Zefirov
2010/10/27 Andy Stewart :
> Serguey Zefirov  writes:
>> I think that you should use TH properly, without compiler and logical errors.
>>
>> What actually do you want?
> I'm build multi-processes communication program.

You don't need TH here, I think.

You can write a class Ask:

class Ask a where ask :: YourMonad a

and then instance it:

instance Ask Int where ask = liftIO $ do { putStrLn "Enter integer:";
l <- getLine; return $ read l}
instance Ask Char where ask = liftIO $ do { putStrLn "Enter char:"; l
<- getLine; return $ head l}
instance Ask String where ask = liftIO $ do { putStrLn "Enter
string:"; l <- getLine; return l}
instance (Ask a, Ask b, Ask c) => Ask (a,b,c) where ask = liftIO $ do
{ a <- ask; b <- ask; c <- ask; return (a,b,c)}

You can pass ask values between processes, receiving results of asking.

TH is great and good, but it is that only when you absolutely
exhausted of usual Haskell options.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: what is the status of haskell's mail libraries?

2010-10-27 Thread Günther Schmidt

Hi Michael,

thanks for the link and congratulations on your other work too.

Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell and a complete mail client lib?

2010-10-27 Thread Günther Schmidt

Hi all,

do we Haskellers have a complete Mail client library?

One that goes beyond an unstructured byte string?

Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what is the status of haskell's mail libraries?

2010-10-27 Thread Henk-Jan van Tuyl
On Wed, 27 Oct 2010 04:46:07 +0200, Michael Snoyman   
wrote:



I just release mime-mail[1], which can construct multipart messages.


Note, that this will not run on Windows, as it gives command
  /usr/sbin/sendmail

Regards,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
--
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Stephen Tetley
On 27 October 2010 09:32, Ivan Lazar Miljenovic
 wrote:

> Why not write your own Pretty class for that project then?

Personally I don't like type classes if they're solely for notational
convenience. I want them to be a least a convention and its nicer
still when they genuinely represent something like Monad, Monoid,
Applicative etc. The Pretty class in wl-pprint is a convention. If I'm
using HughesPJ for compatibility I'll do without a type class,
defining my own is just notational convenience.


> Admittedly, some packages might write their own class because they
> didn't want to use non-ghc/platform libraries or prettyclass didn't
> exist then.
>
> I had to write my own [1] for two reasons: 1) I needed to be able to
> differentiate between quoted and un-quoted values, and 2) some of the
> ways values get pretty-printed are different than just "text . show",
> which is what all the default instances of the Pretty classes are
> (with the exception of String).  It's this second point that I would
> wonder how many people would use a default Pretty class: just because
> I want to print String values one way, does that you mean you should
> print them that way as well?

If you were specifically working around issues of quoting, maybe there
would have been room for an alternative design where an Identifier
datatype had two constructors one for simple strings and one for
quoted ones.

In a nutshell, wl-pprint seems to have got the interface 'right' for
my tastes. I like having both named primitive printers and a Pretty
class. If I want printers for ShowS types or for Docs that don't need
page formatting I always copy Wl-pprint's interface.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Ivan Lazar Miljenovic
On 27 October 2010 20:13, Stephen Tetley  wrote:
> On 27 October 2010 09:32, Ivan Lazar Miljenovic
>  wrote:
>
>> I had to write my own [1] for two reasons: 1) I needed to be able to
>> differentiate between quoted and un-quoted values, and 2) some of the
>> ways values get pretty-printed are different than just "text . show",
>> which is what all the default instances of the Pretty classes are
>> (with the exception of String).  It's this second point that I would
>> wonder how many people would use a default Pretty class: just because
>> I want to print String values one way, does that you mean you should
>> print them that way as well?
>
> If you were specifically working around issues of quoting, maybe there
> would have been room for an alternative design where an Identifier
> datatype had two constructors one for simple strings and one for
> quoted ones.

Well, in my case it's because Dot attributes need to have their values
in quotes when they contain spaces, etc.  As such, you have these
situations:

* ` DotNode 1 [Label $ StrLabel "foo"] ' is printed as ` 1 [label=foo] '

* ` DotNode 2 [Label $ StrLabel "bar baz"] ' is printed as ` 2
[label="bar baz"] '

Now, I _could_ have just quoted everything, but I tried to make the
generated Dot code as "correct" as possible.

> In a nutshell, wl-pprint seems to have got the interface 'right' for
> my tastes. I like having both named primitive printers and a Pretty
> class. If I want printers for ShowS types or for Docs that don't need
> page formatting I always copy Wl-pprint's interface.

OK, I'll keep the class in as well.

What about my other queries (e.g. to keep SimpleDoc or not)?

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Does it deserve to be a hackage package?

2010-10-27 Thread Andy Stewart
Christopher Done  writes:

> On 27 October 2010 10:13, Dmitry V'yal  wrote:
>> While ago I had a question about opening the url in the default browser from
>> haskell program. I didn't get any immediate answers so I wrote my own
>> solution. On Linux it uses xdg-open and on Windows - ShellExecute Api.
>
>> Does it deserve to be a hackage package?
>
> If it's not in an existing small library, yes. If I have to have a
> dependency on gtk2hs just to do that, I'd rather have a small library.
> Does it work on OS X? If not, I'm sure someone would submit a patch
> for that. This can also be used for opening the file browser and such,
> right?
It's APIs in GIO library (a sub-library in gtk2hs), you just need depend
on GIO don't need depend any other library.

Dmitry, it's unnecessary since GIO can do better with same experience
both Windows and Linux, don't need any external program help.
Infact, GIO not just call default browser for url, it can call any
program to open any format.

Example, you install many different PDF-Viewer in your system, it will
return a Application list for *.pdf format...etc.

Good news is, gtk2hs-0.12.0 has ready for release, we will wait one week,
if no user report any bug of gtk2hs darcs, we will release.
Then you can use it.

Cheers,

  -- Andy


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what is the status of haskell's mail libraries?

2010-10-27 Thread Michael Snoyman
On Wed, Oct 27, 2010 at 10:39 AM, Henk-Jan van Tuyl  wrote:
> On Wed, 27 Oct 2010 04:46:07 +0200, Michael Snoyman 
> wrote:
>
>> I just release mime-mail[1], which can construct multipart messages.
>
> Note, that this will not run on Windows, as it gives command
>  /usr/sbin/sendmail

The sendmail feature will not work on Windows (and you're right, I
should document that more clearly). However, rendering of email
messages is completely cross-platform, and there was some talk of
getting either HaskellNet or SMTPClient to work with mime-mail, which
would allow direct sending of email via SMTP.

Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell and a complete mail client lib?

2010-10-27 Thread Andy Stewart
Günther Schmidt  writes:

> Hi all,
>
> do we Haskellers have a complete Mail client library?
>
> One that goes beyond an unstructured byte string?
I want mail-client library too, for my gtk2hs project
(http://www.flickr.com/photos/48809...@n02/)

If still haven't complete mail-client library when i want build
mail-client, i will write one.

Please let me know if someone working on mail-client library, i want
play. :)

Cheers,

  -- Andy

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] who's in charge?

2010-10-27 Thread Günther Schmidt

Hi all,

this may be an odd question to some, but I think it's actually quite an 
un-extraordinary one.


Who's in charge?

Of Haskell I mean. If there was some alien from Planet Java to land on 
Planet Haskell and demand to be taken to our leader, whom would we take 
him to?


Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Ivan Lazar Miljenovic
2010/10/27 Günther Schmidt :
> Hi all,
>
> this may be an odd question to some, but I think it's actually quite an
> un-extraordinary one.
>
>        Who's in charge?
>
> Of Haskell I mean. If there was some alien from Planet Java to land on
> Planet Haskell and demand to be taken to our leader, whom would we take him
> to?

The Haskell' committee?

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Günther Schmidt

Hi Ivan,

there is a committee?

Günther

Am 27.10.10 12:37, schrieb Ivan Lazar Miljenovic:

2010/10/27 Günther Schmidt:

Hi all,

this may be an odd question to some, but I think it's actually quite an
un-extraordinary one.

Who's in charge?

Of Haskell I mean. If there was some alien from Planet Java to land on
Planet Haskell and demand to be taken to our leader, whom would we take him
to?

The Haskell' committee?



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Ivan Lazar Miljenovic
2010/10/27 Günther Schmidt :
> Hi Ivan,
>
> there is a committee?

Sure is:

http://hackage.haskell.org/trac/haskell-prime/

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Chart v0.14

2010-10-27 Thread Tim Docker

I'm pleased to announce v0.14 of the haskell chart library. This is a
library for drawing 2D data plots. It's features include

   + Use of the cairo graphics engine, supporting a variety of
 output types: ps, pdf, png, and gtk windows.

   + A variety of plot types, including: points, lines, error bars,
 candlesticks, bar charts and pie charts.

   + Strong typing. Charts are parameterized by the types of their
 coordinates. One benefit of this is that labels etc are
 automatically generated appropriately for the type of the
 data. Currently axis types include: Double, Int, Log, LocalTime,
 and Indexed.

   + (some) support for interactivity. Charts support dynamic
 resizing, and mapping from device coordinates back to source
 values.

The library is available on hackage. Additional information including
details of the mailing list can be found here:

http://dockerz.net/software/chart.html

Thanks to Malcolm Wallace, Eugene Kirpichov, and Matt Brown for their
contributions to this release.

Tim Docker

--

New features in v0.14
-

* Plot Type: AreaSpots4D
Spots with varying area and colour

* Plot Type: CandleStick charts
A specific type of plot often used in financial markets for stock
price series.

* Multiline text in Annotation Plots
with flexible control over the anchoring.

* Picking.
The library now contains logic required to map device coordinates back
to input elements. This facilitates interactivity. See tests/TestPicking.hs.

* Multiple Layers of axis labels
This is currently used by the LocalTime axis to show an additional set
of context labels - these show the next sensible granularity of time
enclosing the more detailed labels and ticks.

* Avoid overlapping axis labels
The axis rendering code now skips labels where there would be
overlaps. This is done dynamically as the chart is rendered.

* Code refactor
Plots and axes have been split into separate file hierarchies, with one file
per type. This makes it easier to understand, and (hopefully) makes it
clearer how to add new plot types.




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: ANN: Chart v0.14

2010-10-27 Thread Eugene Kirpichov
Good news!

Thanks, Tim!

I'd like to also note that now the LocalTime axis supports millisecond
precision, whereas earlier it only supported second precision.

2010/10/28 Tim Docker :
> I'm pleased to announce v0.14 of the haskell chart library. This is a
> library for drawing 2D data plots. It's features include
>
>   + Use of the cairo graphics engine, supporting a variety of
>     output types: ps, pdf, png, and gtk windows.
>
>   + A variety of plot types, including: points, lines, error bars,
>     candlesticks, bar charts and pie charts.
>
>   + Strong typing. Charts are parameterized by the types of their
>     coordinates. One benefit of this is that labels etc are
>     automatically generated appropriately for the type of the
>     data. Currently axis types include: Double, Int, Log, LocalTime,
>     and Indexed.
>
>   + (some) support for interactivity. Charts support dynamic
>     resizing, and mapping from device coordinates back to source
>     values.
>
> The library is available on hackage. Additional information including
> details of the mailing list can be found here:
>
>    http://dockerz.net/software/chart.html
>
> Thanks to Malcolm Wallace, Eugene Kirpichov, and Matt Brown for their
> contributions to this release.
>
> Tim Docker
>
> --
>
> New features in v0.14
> -
>
> * Plot Type: AreaSpots4D
> Spots with varying area and colour
>
> * Plot Type: CandleStick charts
> A specific type of plot often used in financial markets for stock
> price series.
>
> * Multiline text in Annotation Plots
> with flexible control over the anchoring.
>
> * Picking.
> The library now contains logic required to map device coordinates back
> to input elements. This facilitates interactivity. See tests/TestPicking.hs.
>
> * Multiple Layers of axis labels
> This is currently used by the LocalTime axis to show an additional set
> of context labels - these show the next sensible granularity of time
> enclosing the more detailed labels and ticks.
>
> * Avoid overlapping axis labels
> The axis rendering code now skips labels where there would be
> overlaps. This is done dynamically as the chart is rendered.
>
> * Code refactor
> Plots and axes have been split into separate file hierarchies, with one file
> per type. This makes it easier to understand, and (hopefully) makes it
> clearer how to add new plot types.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haskell Charts" group.
> To post to this group, send email to haskell-cha...@googlegroups.com.
> To unsubscribe from this group, send email to
> haskell-charts+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haskell-charts?hl=en.
>
>



-- 
Eugene Kirpichov
Senior Software Engineer,
Grid Dynamics http://www.griddynamics.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] cross-platform compile

2010-10-27 Thread Ari Rahikkala
On Tue, Oct 26, 2010 at 9:51 PM, Hong Yang  wrote:
> Just curious if Haskell can or will generate cross-platform executable code,
> e.g., generate code for Linux from a Windows machine.
>
> Thanks,
>
> Hong

I don't know about other compilers, but at least GHC is not quite
there yet: 
http://www.haskell.org/pipermail/glasgow-haskell-users/2010-June/018893.html

In my experience, compiling for Windows on Linux, setting up the
Windows release GHC itself for running on Wine is easy enough.
Libraries can be a lot more fiddly - for instance my rather
avant-garde msys-on-wine setup didn't play well with the configure
script in the network package so I had to install it on
msys-on-Windows. Be ready to set up your PATH yourself, fiddle with
linker flags, and remember that the gcc version that comes with the
current GHC Windows release is still 3.4.5.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Martijn Schrage

On 21-10-10 01:01, Victor Nazarov wrote:

I've been working on this for some month and I think now I'm ready to
share the results.

Great stuff! I've been looking for something like this for a long time.

If you add "|| transport.status == 0" to line 90 of 
examples/rts-common.js, it also works on a local file system.


I played around with it a bit to see how easy it was to call JavaScript 
from Haskell, and it turned out to be straightforward. With a little 
guessing, I constructed a JavaScript representation of a thunk, which 
evaluates its string argument as a JavaScript expression and returns the 
resulting string to Haskell. This thunk can be passed to the 
JavaScript-compiled Haskell function. To pass it around in Haskell and 
force its evaluation, I constructed a simple monad.


Now, on your web page, you can do something like:



and in a Haskell module:

validate :: JS ()
validate =
 do { inputValue <- eval "document.getElementById('inputField').value"
; exec $ 
"document.getElementById('inputField').style.backgroundColor="++

 color inputValue
}
 where color str = if and (map isDigit str) then "'white'" else "'red'"

This example creates a text field that turns red if it contains any 
non-digit characters. It is on-line at 
http://tryout.oblomov.com/ghcjs/ghcjs.html  (Note: I only tested it on 
Firefox on a Mac)


All used files are in a zip file at 
http://tryout.oblomov.com/ghcjs/ghcjs.zip (validate is in Test.hs, the 
JS monad in JS.hs, and the JavaScript for execHaskell in util.js)


Cheers,
Martijn Schrage -- Oblomov Systems
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: timeplot-0.2.1, a tool for visualizing time series from log files.

2010-10-27 Thread Eugene Kirpichov
Hi cafe,

I'm pleased to announce timeplot-0.2.1.
http://hackage.haskell.org/package/timeplot

This is a tool for visualizing time series from log files.

I'm myself using it for diagnosing performance of distributed systems:
I aggregate their logs and plot various things, such as the number of
tasks executing on each machine of the cluster, or quantiles of
database query times, etc.

See pretty pictures on haskellwiki:
http://www.haskell.org/haskellwiki/Timeplot

This version has several changes, which together raised the program's
usefulness for me tremendously:

 - The program now builds and works on Windows! You just need gtk2hs.
I got rid of strptime and pcre dependencies (strptime is built from
bundled and patched source, and I use regex-tdfa by Chris Kuklewicz).

 - Support for millisecond precision on charts (thanks to the new 0.14
version of Tim Docker's excellent Chart library)
 - Support for millisecond precision in input (because I re-did
strptime to compile from scratch with support for the %OS pattern,
which recognizes fractional seconds)
 - Support for selecting a range of the input (however,
non-interactively) with "-fromTime/-toTime"
 - Support for "duration" plots: given an event track (where events of
something beginning or ending are recorded), you can produce all kinds
of plots over the durations of these events.
 - Support for colored "status" plots: now event tracks represent not
purely the presence or absence of an active event, but an event track
can be colored, representing several states of a subsystem or
subprocess.

Please use the program and provide feedback :) I have a hope that it
could become a reasonably widely used tool for the kinds of tasks that
I use it for.

-- 
Eugene Kirpichov
Senior Software Engineer,
Grid Dynamics http://www.griddynamics.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Dougal Stanton
2010/10/27 Ivan Lazar Miljenovic :
> 2010/10/27 Günther Schmidt :
>> Hi all,
>>
>> this may be an odd question to some, but I think it's actually quite an
>> un-extraordinary one.
>>
>>        Who's in charge?
>>
>> Of Haskell I mean. If there was some alien from Planet Java to land on
>> Planet Haskell and demand to be taken to our leader, whom would we take him
>> to?
>
> The Haskell' committee?

They're just figureheads for a shadowy cabal :-D



-- 
Dougal Stanton
dou...@dougalstanton.net // http://www.dougalstanton.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Steve Schafer
On Wed, 27 Oct 2010 14:13:31 +0100, you wrote:

>They're just figureheads for a shadowy cabal :-D

You mean the Haskelluminati?

-Steve Schafer
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Ryan Yates
I ran into a problem with line 31 of examples/rts-common.js when running on
Chrome:
>var word16addCarry = function function(a, b, c) {

Shouldn't that be:
>var word16addCarry = function(a, b, c) {

With that change it runs fine for me (GHC 6.12.3).  Chrome also wasn't happy
loading from the local file system (Cross origin requests are only supported
for HTTP), so I just used happstack to test:

>import Happstack.Server
>main = simpleHTTP nullConf (fileServe [] "./")
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Malcolm Wallace

Who's in charge?


If you mean the language, then the Haskell-prime committee is in charge.

If you mean the compiler everyone uses (de-facto), then the two Simons  
are in charge.


If you mean the website, online resources, and money earned from GSoC  
or donated, then there is a committee being set up right now to decide  
policy on those kinds of things.


If you mean academic research into Haskell, then of course no-one is  
in charge, and everyone does what they see fit (and can get funding  
for).  But there is a steering committee for the annual Haskell  
Symposium.


There are also other bodies like the Industrial Haskell Group, who  
will typically have some small committee in charge of their (more  
restricted) focus area.


Regards,
Malcolm
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Günther Schmidt

Hi Malcolm,

well if I would like to point out that, for instance, Haskell exists for 
a lot more than 10 years now, and that, while the language per se rocks, 
and there are cool tools (cabal) and libraries (list, Set, Map), there 
still isn't even a mail client library, I wonder whom to escalate this 
to, and who is going to do something about it.


I understand some parties wish to avoid success at all costs, while 
others, commercial users, benefit from the edge haskell gives them 
already and which probably can help themselves in case of, again, for 
instance a missing mail client library.


And then there is the ones like me, which also want to benefit from the 
edge Haskell gives them over users of other languages and want to 
develop Real World Apps and who cannot easily help themselves in case of 
a missing mail client library.



So while there are many aspects of the future of haskell, who 
effectively is it that steers the boat?


Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pretty-printer for Text

2010-10-27 Thread Antoine Latter
On Tue, Oct 26, 2010 at 9:50 PM, Ivan Lazar Miljenovic
 wrote:
> I'm currently working on a pretty-printer for lazy text [1] values,
> basing the API on the wl-pprint [2] package.
>
> [1]: http://hackage.haskell.org/package/text
> [2]: http://hackage.haskell.org/package/wl-pprint
>
> In terms of API decisions, there are a few things I'm not sure of and
> am wondering what other people would prefer:
>
> * Should the SimpleDoc type still be exported?  Or should the
> rendering functions just return a Builder or lazy Text value?

I'm not really sure what you're asking here, but I find BS Builders
pretty convenient to work with. A recent release of 'text' includes a
Builder type.

>
> * Is the Pretty class wanted/needed?  If so, should the individual
> combinators (int, bool, etc.) be kept or just use "pretty" for
> everything?

I frequently write a 'Pretty' class when writing complex ASTs, but I
have never found it to be a hardship. I prefer using well-named
combinators for primitive types.

>
> * Should String values be catered for or just have everything be Text-based?

The OverloadedStrings language extension solves the most common case
for wanting to have string-based pretty-printer functions.

Antoine
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Victor Nazarov
On Wed, Oct 27, 2010 at 4:30 PM, Martijn Schrage  wrote:
> On 21-10-10 01:01, Victor Nazarov wrote:
>>
>> I've been working on this for some month and I think now I'm ready to
>> share the results.
>
> Great stuff! I've been looking for something like this for a long time.
>
> If you add "|| transport.status == 0" to line 90 of examples/rts-common.js,
> it also works on a local file system.
>

Thank you, I'll fix it.

> I played around with it a bit to see how easy it was to call JavaScript from
> Haskell, and it turned out to be straightforward. With a little guessing, I
> constructed a JavaScript representation of a thunk, which evaluates its
> string argument as a JavaScript expression and returns the resulting string
> to Haskell. This thunk can be passed to the JavaScript-compiled Haskell
> function. To pass it around in Haskell and force its evaluation, I
> constructed a simple monad.
>

Very cool. I'll incorporate your changes, If you don't mind.
However, I have some minor remarks.
You shouldn't override hscall function, or you may break partial
application implementation. And you shouldn't overide properties of
evalFn, I wonder that this doesn't break your example...

var evalFn = new $hs.Func(1);
evalFn.evaluate(arg) = function(arg) {
  var argStr = $hs.fromHaskellString(arg);
  var res = eval(argStr);
  return $hs.toHaskellString(arg); // This function should be added to
$hs object/namespace
}

> Now, on your web page, you can do something like:
>
> 
>
> and in a Haskell module:
>
> validate :: JS ()
> validate =
>  do { inputValue <- eval "document.getElementById('inputField').value"
>    ; exec $ "document.getElementById('inputField').style.backgroundColor="++
>             color inputValue
>    }
>  where color str = if and (map isDigit str) then "'white'" else "'red'"
>

I think we should do something like this:

data JsObject = ... -- Should be made abstract

and

eval :: String -> [JsObject] -> JS JsObject

So we can pass around javascript-objects in haskell program and bind
them back into javascript calls.
And use some conversion functions in case when we need data:

jsObjectToString :: JsObject -> JS String
jsObjectToInt :: JsObject -> JS Int

-- 
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Victor Nazarov
On Wed, Oct 27, 2010 at 5:25 PM, Ryan Yates  wrote:
> I ran into a problem with line 31 of examples/rts-common.js when running on
> Chrome:
>>    var word16addCarry = function function(a, b, c) {
> Shouldn't that be:
>>    var word16addCarry = function(a, b, c) {

Yes, that's my fault. I'll fix it.

> With that change it runs fine for me (GHC 6.12.3).  Chrome also wasn't happy
> loading from the local file system (Cross origin requests are only supported
> for HTTP), so I just used happstack to test:
>>    import Happstack.Server
>>    main = simpleHTTP nullConf (fileServe [] "./")
>
>

I wasn't able to run it in Chrome without dedicated HTTP-server, seems
like it is the only way...

-- 
Victor Nazarov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-27 Thread Ryan Yates
>
> I wasn't able to run it in Chrome without dedicated HTTP-server, seems
> like it is the only way...
>
>
It looks like running Chrome with the flag:
-allow-file-access-from-files
lets it work.

Thanks for making this project, I'm looking forward to more!

Ryan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread caseyh

:)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Thomas DuBuisson
How does python having an e-mail library change the situation with
calling Python from Haskell?

On Wed, Oct 27, 2010 at 10:43 AM,   wrote:
> :)
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Christopher Done
On 27 October 2010 19:46, Thomas DuBuisson  wrote:
> How does python having an e-mail library change the situation with
> calling Python from Haskell?

He's commenting, presumably, on the apparently disparate nature of
Haskell email libraries and the fortuitousness therefore of Python
having a describadly good email library, not that this changes the
difficulties in interfacing with Python in general.

On 27 October 2010 19:43,   wrote:
> :)

glguy's Github interfaces with Python; it involves some C, naturally,
but it's not complicated: http://github.com/glguy/hpaste
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell and a complete mail client lib?

2010-10-27 Thread Don Stewart
gue.schmidt:
> Hi all,
>
> do we Haskellers have a complete Mail client library?

As always, look on Hackage:


http://www.google.com/search?hl=en&as_sitesearch=hackage.haskell.org/package&as_q=email
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread aditya siram
Are there any C libraries that you can use? I did a google search on email
client in c and failed in an epic fashion but I figure parts of sendmail or
mutt could be used.
-deech

On Wed, Oct 27, 2010 at 12:55 PM, Christopher Done  wrote:

> On 27 October 2010 19:46, Thomas DuBuisson 
> wrote:
> > How does python having an e-mail library change the situation with
> > calling Python from Haskell?
>
> He's commenting, presumably, on the apparently disparate nature of
> Haskell email libraries and the fortuitousness therefore of Python
> having a describadly good email library, not that this changes the
> difficulties in interfacing with Python in general.
>
> On 27 October 2010 19:43,   wrote:
> > :)
>
> glguy's Github interfaces with Python; it involves some C, naturally,
> but it's not complicated: http://github.com/glguy/hpaste
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Günther Schmidt

Am 27.10.10 19:43, schrieb cas...@istar.ca:

:)


Well I was considering using a foreign library too for email. It creates 
a whole lot of dependencies, so I'd prefer to be able to do it entirely 
in Haskell instead.


I was also wondering if it's possible to create a DSL for the email 
stuff and then use different interpreters for such terms which could 
evaluate to calling foreign lib (on Windows possibly MAPI).


Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Need programming advice for Network Protocol Parsing

2010-10-27 Thread Günther Schmidt

Hi all,

I'd like to write a client app that communicates with a server over TCP/IP.

My question is in regard which parser to use for the servers responses. 
I'm quite familiar with parsec (2.x) but I'm not sure if it's the right 
choice for this. The code would necessarily constantly be switching 
between checking for input, interpreting and then responding.


Any suggestions?

Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Donn Cave
Don't know, but probably challenging enough to make it worth challenging
the assumption that Python now has a good email library.

>From a cursory look at the 3.0 library documentation, it looks to
me like IMAP support still means the old imaplib module.  That's
pretty rudimentary, compared to the HaskellNet IMAP support.

Donn Cave, d...@avvanta.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need programming advice for Network Protocol Parsing

2010-10-27 Thread Christopher Done
2010/10/27 Günther Schmidt :
> My question is in regard which parser to use for the servers responses. I'm
> quite familiar with parsec (2.x) but I'm not sure if it's the right choice
> for this. The code would necessarily constantly be switching between
> checking for input, interpreting and then responding.

Attoparsec is kind of made for this:
http://hackage.haskell.org/package/attoparsec
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell and a complete mail client lib?

2010-10-27 Thread Gwern Branwen
2010/10/27 Don Stewart :
> gue.schmidt:
>> Hi all,
>>
>> do we Haskellers have a complete Mail client library?
>
> As always, look on Hackage:
>
>    
> http://www.google.com/search?hl=en&as_sitesearch=hackage.haskell.org/package&as_q=email

Besides the tagged packages, there are a few other places one could
look if one searched the package listings carefully:

- http://hackage.haskell.org/package/HaskellNet
- http://hackage.haskell.org/package/postmaster
- http://hackage.haskell.org/package/pop3-client

Are any of these *complete*? Dunno. But I suspect you do not actually
need to do everything one could possibly do with email.

-- 
gwern
http://www.gwern.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Brandon Moore


On Oct 27, 2010, at 12:43 PM, cas...@istar.ca wrote:
> :)

I will point out that "Python Haskell Interface" has an excellent axiom. 
Unfortunately, my attempt to write a nice wrapper around the Python FFI 
foundered years ago chasing segfaults. It doesn't seem like it should be too 
hard, if you get the reference counting right - and tie everything to the GIL 
(ick).


  
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Albert Y. C. Lai

On 10-10-27 06:31 AM, Günther Schmidt wrote:

this may be an odd question to some, but I think it's actually quite an
un-extraordinary one.

Who's in charge?

Of Haskell I mean. If there was some alien from Planet Java to land on
Planet Haskell and demand to be taken to our leader, whom would we take
him to?


This is in many ways (more ways than I expect) like:

How to do the visitor pattern? If a visitor from Java landed on Haskell 
and wanted to do the visitor pattern?


Of course, to be fair, there are also converses:

How to define infix operators in Java? If a visitor from Haskell landed 
on Java and wanted to define his/her own infix operators?


You just can't shoehorn one model into another. You can't shoehorn one 
language model into another, but more importantly, you can't shoehorn 
one community model into another.


Some people, when confronted with the problem of lacking a library, say 
"I know, a leader would make sure the library happens". Now they have a 
bigger problem.


The leader might instead make sure that the library will never happen.

Python has a leader, no? This leader has suppressed much-needed 
libraries and much-needed alternative implementations. Examples are 
cycle-robust GC and stackless function calls.


There are libraries on Hackage that I am pretty sure a leader of Haskell 
would have killed.


A leader of Haskell who would take "avoid success at all costs" too 
seriously would kill all of Hackage and censor the word "Cabal".


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need programming advice for Network Protocol Parsing

2010-10-27 Thread Daniel Peebles
I'm occasionally working on making a friendly yet performant library that
simultaneously builds parsers and generators, but it's non-trivial. If you
want to see the general idea, there's a Functional Pearl on pickler
combinators from a few years back that you can probably play with.

But for a real network protocol that you need to implement today, I'd go
with attoparsec or Data.Binary.

2010/10/27 Günther Schmidt 

> Hi all,
>
> I'd like to write a client app that communicates with a server over TCP/IP.
>
> My question is in regard which parser to use for the servers responses. I'm
> quite familiar with parsec (2.x) but I'm not sure if it's the right choice
> for this. The code would necessarily constantly be switching between
> checking for input, interpreting and then responding.
>
> Any suggestions?
>
> Günther
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell and a complete mail client lib?

2010-10-27 Thread Günther Schmidt

Hi Don,

thank your this link.

Also thank you for supplying a link to this page 
http://www.reddit.com/r/haskell_proposals/top/?t=year in another 
message, some time back.


I can see that checking there first would have made my entire post 
redundant.


Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2010-10-27 Thread Andrew Coppin

On 27/10/2010 05:00 PM, John Lato wrote:
I am somewhat surprised that all capabilities must be ready for GC; I 
thought with the parallel GC that wouldn't be necessary.  But I don't 
know much about GC implementations so I try not to let their behavior 
surprise me too much.


GHC has a _parallel_ GC implementation, meaning that the GC event runs 
in parallel on several cores. But it does not (yet) have _concurrent_ 
GC, meaning that a GC event can happen at the same time as Haskell 
threads are running. (Basically, which Haskell code running, the 
references between objects could change while the GC engine is trying to 
analyse them, which would be Bad.) I understand that the developers are 
actively working on fixing this, since it can sometimes have a 
significant effect on the performance of multicore programs...


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread Richard O'Keefe

On 28/10/2010, at 4:38 AM, Günther Schmidt wrote:
> As we are 10+ years now still without one of the most essential libraries any 
> programming language needs I guess it's not that easy. It has just been 
> recently that I wanted to do email via haskell. I was very surprised not find 
> one in place already.

There is no standard E-mail library for Ada, Fortran, COBOL, PL/I, or a great 
many
languages.  Fortran and COBOL have been around for fifty years, not ten.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] On being called a troll

2010-10-27 Thread Günther Schmidt

Hi everyone,

this post is to argue my own case.

Today I have made the most upsetting experience of being called a troll, 
twice.


I have posted to this list for over 3 years now and until lately it was 
an enlightening experience. The responses to my questions have usually 
been helpful and friendly.


But for some time now, I have noticed that the tone on this list has 
changed. It seems to have become ok to respond quite brutally and 
without regard for the other persons feelings. It also seems to have 
become ok to chime in. For some reason it has become acceptable to 
politicalize a subject at the earliest convenience and take the gloves off.


I am 42 now and am surprised how much this still hurts, after all I 
survived the schoolyard bullies and who would have thought that these 
times would ever come again?


I urge you, my fellow haskellers, to show some restraint when we are 
dealing with one another on this list. And to think twice before you 
launch a personal attack.


Günther

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] who's in charge?

2010-10-27 Thread aditya siram
Careful. That might draw some unwarranted comparisons :)
-deech

2010/10/27 Richard O'Keefe 

>
> On 28/10/2010, at 4:38 AM, Günther Schmidt wrote:
> > As we are 10+ years now still without one of the most essential libraries
> any programming language needs I guess it's not that easy. It has just been
> recently that I wanted to do email via haskell. I was very surprised not
> find one in place already.
>
> There is no standard E-mail library for Ada, Fortran, COBOL, PL/I, or a
> great many
> languages.  Fortran and COBOL have been around for fifty years, not ten.
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Where has GDK.GC gone?

2010-10-27 Thread Andrew Coppin

Today I noticed a small but interesting fact:

Under Gtk2hs 0.10.x, the module Graphics.UI.Gtk re-exports (amoung 
countless others) the module Graphics.UI.Gtk.Gdk.GC. However, under 
Gtk2hs 0.11.x, it does not. After downloading the darcs repo (with took 
forever, by the way), I discovered that the requisit line still exists 
in the source code, but it has been commented out. My repeated attempts 
to force Darcs to tell me exactly which patch did this resulted only in 
Darcs locking up again and again. (I'm quite surprised at that. Usually 
all Darcs operations are instantaneous. I guess the local repo is 
corrupt somehow or something...)


So anyway, what I'd like to know is... was this alteration intensional? 
Or was it just an oversight?


PS. The link on the website that says "browse the darcs repo online"? 
Apache just returns 404 at me. This is not particularly helpful.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] New repo location for the network package

2010-10-27 Thread Johan Tibell
Hi all,

To ease my maintenance burden, I've moved the network package repo to:

http://github.com/haskell/network

Patches are accepted either in the git mbox format, as normal (diff)
patch files, or as GitHub pull requests.

P.S. If you want to get added to the haskell GitHub organization, just
drop me an email.

Johan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] On being called a troll

2010-10-27 Thread Anton van Straaten

Günther,

On 10/27/2010 05:12 PM, you wrote:

For some reason it has become acceptable to
politicalize a subject at the earliest convenience and take the gloves off.


You were the first offender, when you wrote the following:

"since there is no mail client library even after 10+ years I suggest to 
rethink the approach, because frankly, it's not working."


Nobody provoked this comment, it was apparently a result of nothing more 
than your rather immature frustration at being unable to immediately 
obtain a free library to satisfy your needs with little effort on your part.


"Trolling" is one of the kinder words that could be used to describe 
such behavior.



I urge you, my fellow haskellers, to show some restraint when we are
dealing with one another on this list.


It would help your own credibility if you would acknowledge your own 
role in the matter before calling for others to show restraint.  If you 
were to follow your own advice, you wouldn't need to be posting comments 
like this.


Anton
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need programming advice for Network ProtocolParsing

2010-10-27 Thread Claus Reinke

I'm occasionally working on making a friendly yet performant library that
simultaneously builds parsers and generators, but it's non-trivial. If you


I'm probably missing something in the "friendly yet performant"
requirements, but I never quite understood the difficulty:

A typical translation of grammar to parser combinators has very
little code specific to "parsing" - it is mostly encoding the grammar
in a coordination framework that calls on literal parsers at the
bottom. Since the coordination framework uses some form of
state transformers, exchanging the literal  parsers with literal
unparsers should turn the grammar parser into a grammar
unparser (in essence, the non-terminal code is reusable, the
terminal code is specific to the direction of data flow).

Add switch-points (where the "mode" can switch from parsing
to unparsing and back), and one has syntax-directed editors
(here you need to be able to restart the process on arbitrary
non-terminals), or expect-like protocol-driven computations
(two or more agents with complementary views of which
parts of the grammar involve parsing and which unparsing).

The non-trivial parts I remember are to ensure that the unparser
is directed by the AST (unless you want to generate random
sentences from the whole language), just as the parser is directed
by the input String, and not biasing the combinator framework
towards parsing (which happens all too easily). But then, it has
been a long time since I wrote such parser/unparsers (the first
before Monads and do-notation became must-have aspects of
combinator parsers, when we were free just to "make it work";-).

It would be useful to have an overview of the issues that
lead to the widespread view of this being non-trivial (other
than in the narrow interpretation of "non-trivial" as "needs
some code"). I've always wondered why there was so much
focus on just parsing in combinator libraries.

Just curious,
Claus


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] If Python now has a good email library; how challenging is it to call Python from Haskell?

2010-10-27 Thread Brandon Moore
> From: Brandon Moore 

> On Oct 27, 2010, at 12:43 PM, cas...@istar.ca wrote:
> > :)
> 
> I  will point out that "Python Haskell Interface" has an excellent axiom.  
>Unfortunately, my attempt to write a nice wrapper around the Python FFI  
>foundered years ago chasing segfaults. It doesn't seem like it should be too  
>hard, if you get the reference counting right - and tie everything to the GIL  
>(ick).

Quite a typo. That should be "an excellent abbreviation" (PHI).

Brandon



  
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Weekly News: Issue 156 - October 27, 2010

2010-10-27 Thread Daniel Santa Cruz
   Welcome to issue 156 of the HWN, a newsletter covering developments in
   the [1]Haskell community in the week of October 17 - 28.

   I did not manage to filter out good posts from Haskell-Cafe this week.
   If you see a thread in -cafe that you think would be good to share with
   the community, please do share it with me. I need to find a better way
   of keeping up with the mountain of posts to that list.

   There were a total of 34 new stories posted to the Haskell Reddit
   channel (+10), 47 new questions taged with Haskell in StackOverflow
   (+20), and 332 messages posted to Haskell-Cafe (-76).

   So, what was hot last week?

Announcements

   John Hughes [2]announced that the Functional Programming group at
   Chalmers is recruiting a postdoctoral researcher for a two year
   position, starting as soon as possible.

   Wouter Swierstra [3]called for workshop and co-located event proposals
   for the ICFP 2011 in Tokyo, Japan.

   Zhong Shao [4]informed us that the Department of Computer Science at
   Yale University is seeking applicants for a PostDoc and PhD positions
   in the broad area of certified software.

   Josh Tripplett wrote in to tell us about Ore, a [5]packaging system for
   Ruby inspired by Haskell's Cabal!

   According to [6]this haskell community calendar, there are 2 events to
   take note happening next week: The Haskell Communities & Activities
   Report submission deadline on Nov 1, and BelHac (in Ghent, Belgium) on
   Nov 5 - 7.

Top Reddit Stories

  * The Haskell Platform is now in Ubuntu
Domain: packages.ubuntu.com
Score: 58, Comments: 5
On Reddit: 
http://www.reddit.com/r/haskell/comments/dtffi/the_haskell_platform_is_now_in_ubuntu/
Original: http://packages.ubuntu.com/maverick/haskell-platform

  * ghcjs: Haskell to Javascript: now released
Domain: github.com
Score: 36, Comments: 4
On Reddit: 
http://www.reddit.com/r/haskell/comments/dujnb/ghcjs_haskell_to_javascript_now_released/
Original: http://github.com/sviperll/ghcjs#readme

  * GHC Blog: New directions for Template Haskell
Domain: hackage.haskell.org
Score: 32, Comments: 3
On Reddit: 
http://www.reddit.com/r/haskell/comments/dtav8/ghc_blog_new_directions_for_template_haskell/
Original: 
http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal

  * A brief tale of faster equality
Domain: serpentine.com
Score: 27, Comments: 10
On Reddit: 
http://www.reddit.com/r/haskell/comments/dt76u/a_brief_tale_of_faster_equality/
Original: 
http://www.serpentine.com/blog/2010/10/19/a-brief-tale-of-faster-equality/

  * MTL 2.0 has been uploaded good bye old mtl, hello monads-fd!
Domain: hackage.haskell.org
Score: 25, Comments: 6
On Reddit: 
http://www.reddit.com/r/haskell/comments/dx8ml/mtl_20_has_been_uploaded_good_bye_old_mtl_hello/
Original: http://hackage.haskell.org/package/mtl-2.0.0.0

  * Haskell Rapid Transit
Domain: mtnviewmark.wordpress.com
Score: 23, Comments: 4
On Reddit: 
http://www.reddit.com/r/haskell/comments/duqp0/haskell_rapid_transit/
Original: http://mtnviewmark.wordpress.com/2010/10/21/haskell-rapid-transit/

  * mathblog: A program for creating and managing a static,
mathematically-inclined weblog
Domain: hackage.haskell.org
Score: 20, Comments: 0
On Reddit: 
http://www.reddit.com/r/haskell/comments/duh1o/mathblog_a_program_for_creating_and_managing_a/
Original: http://hackage.haskell.org/package/mathblog-0.2

  * Lazy Type-Level Programming: nice trick by Max Bolingbroke
Domain: haskell.org
Score: 20, Comments: 1
On Reddit: 
http://www.reddit.com/r/haskell/comments/duu54/lazy_typelevel_programming_nice_trick_by_max/
Original: 
http://www.haskell.org/pipermail/haskell-cafe/2010-October/085307.html

  * Let's build a compiler (in Haskell): Part 12 - Introducing the State Monad
Domain: alephnullplex.appspot.com
Score: 19, Comments: 14
On Reddit: 
http://www.reddit.com/r/haskell/comments/du38c/lets_build_a_compiler_in_haskell_part_12/
Original: 
http://alephnullplex.appspot.com/blog/view/2010/10/19/lbach-introducing-the-state-monad

  * What's the status of Haskell on the iPhone?
Domain: self.haskell
Score: 18, Comments: 5
On Reddit: 
http://www.reddit.com/r/haskell/comments/dsyij/whats_the_status_of_haskell_on_the_iphone/
Original: 
/r/haskell/comments/dsyij/whats_the_status_of_haskell_on_the_iphone/

Top StackOverflow Questions

  * Question (votes: 33, answers: 8):
Best explanation for Languages without Null
Read on SO:
http://stackoverflow.com/questions/3989264/best-explanation-for-languages-without-null

  * Question (votes: 16, answers: 6):
Saving my running toplevel for later
Read on SO:
http://stackoverflow.com/questions/3966925/saving-my-running-toplevel-for-later

  * Question (votes: 10, answers: 2):
What's the difference between undefined in Haskell and null in Java?
Read on SO:
http://stackoverfl

Re: [Haskell-cafe] On being called a troll

2010-10-27 Thread Antoine Latter
2010/10/27 Günther Schmidt :
> Hi everyone,
>
> this post is to argue my own case.
>
> Today I have made the most upsetting experience of being called a troll,
> twice.
>
> I have posted to this list for over 3 years now and until lately it was an
> enlightening experience. The responses to my questions have usually been
> helpful and friendly.
>
> But for some time now, I have noticed that the tone on this list has
> changed. It seems to have become ok to respond quite brutally and without
> regard for the other persons feelings. It also seems to have become ok to
> chime in. For some reason it has become acceptable to politicalize a subject
> at the earliest convenience and take the gloves off.
>

I'm in favor of keeping personal accusations off of this list. Calling
someone a troll on a public list isn't really helpful to the
conversation.

In extreme cases, I think some folks have the ability to moderate the
list - so it isn't like we need to resort to public personal attacks
to keep the discussion productive.

> I am 42 now and am surprised how much this still hurts, after all I survived
> the schoolyard bullies and who would have thought that these times would
> ever come again?
>
> I urge you, my fellow haskellers, to show some restraint when we are dealing
> with one another on this list. And to think twice before you launch a
> personal attack.
>
> Günther
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Red links in the new haskell theme

2010-10-27 Thread Victor Oliveira
Hi Cafe,

I really liked the new colors of haskell theme, but...

Is really red a good color for links?  At least for me, red links looks like 
broken or already visited ones.

And the worst is hackage docs. It is really eye tiring to read.

It's just a thought. Maybe it just with me.

What about you?

[]s
Victor___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need programming advice for Network ProtocolParsing

2010-10-27 Thread Sterling Clover
On Oct 27, 2010, at 6:23 PM, Claus Reinke wrote:

>> I'm occasionally working on making a friendly yet performant library that
>> simultaneously builds parsers and generators, but it's non-trivial. If you
> 
> I'm probably missing something in the "friendly yet performant"
> requirements, but I never quite understood the difficulty:
> 
> A typical translation of grammar to parser combinators has very
> little code specific to "parsing" - it is mostly encoding the grammar
> in a coordination framework that calls on literal parsers at the
> bottom. Since the coordination framework uses some form of
> state transformers, exchanging the literal  parsers with literal
> unparsers should turn the grammar parser into a grammar
> unparser (in essence, the non-terminal code is reusable, the
> terminal code is specific to the direction of data flow).

On this topic, folks might be interested in the awesome "Invertible Syntax 
Descriptions" paper presented by Tillmann Rendel and Klaus Ostermann at this 
year's Haskell Symposium: http://www.informatik.uni-marburg.de/~rendel/unparse/

Cheers,
Sterl___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe