Re: [Haskell-cafe] Problems with nested Monads

2009-07-10 Thread wren ng thornton
Job Vranish wrote: Yeah, I think the problem with my case is that while M is a specific monad (essentially StateT), N can be an arbitrary monad, which I think destroys my changes of making a valid joinInner/joinOuter/distribute. Maybe someday Haskell will infer valid joinInner/joinOuter for simpl

Re: [Haskell-cafe] get cabal info for self?

2009-07-10 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Jul 10, 2009 at 11:46 PM, Keith Sheppard wrote: > Is there a way for a cabalized program to get its own info. I'm > specifically interested in version info. > > Thanks > Keith > Sure, via the Paths_* mechanism. For your reference, here's wha

[Haskell-cafe] get cabal info for self?

2009-07-10 Thread Keith Sheppard
Is there a way for a cabalized program to get its own info. I'm specifically interested in version info. Thanks Keith -- keithsheppard.name ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Text.JSON, Speed and Bytestrings

2009-07-10 Thread Max Cantor
Hi Cafe, I am using the Text.JSON library to [un]marshall messages passed over the network and was wondering if the speed would be significantly improved by either changing the code or adding a module to implement the same functionality using Bytestrings instead of classical strings? If

Re: [Haskell-cafe] Laziness enhances composability: an example

2009-07-10 Thread Simon Richard Clarkstone
Thomas Davie wrote: On 9 Jul 2009, at 14:55, Cristiano Paris wrote: I'm wondering what a good example of why laziness enhances composability would be. I'm specifically looking for something that can't implemented in Python with iterators (at least not elegantly), but can actually be implemen

Re: [Haskell-cafe] Problems with nested Monads

2009-07-10 Thread Miguel Mitrofanov
You can do this if D -> M (N D) is a monad itself. I suggest you study monad transformers - may be it's what you really want. On 10 Jul 2009, at 19:34, Job Vranish wrote: I'm trying to make a function that uses another monadic function inside a preexisting monad, and I'm having trouble. Ba

[Haskell-cafe] [Haskell Cafe] Parsec: buildExpressionParser and parens typecheck problem

2009-07-10 Thread Paul Sujkov
Hi haskellers, I'm trying to use buildExpressionParser parser generator from ParsecExpr module of Parsec ( http://legacy.cs.uu.nl/daan/download/parsec/parsec.html#ParsecExpr). It works well, except for the "parens" token parser ( http://legacy.cs.uu.nl/daan/download/parsec/parsec.html#parens). Thi

Re: [Haskell-cafe] Alternative IO

2009-07-10 Thread Dan Doel
On Friday 10 July 2009 4:35:15 am Wolfgang Jeltsch wrote: > I fear that this instance doesn’t satisfy required laws. As far as I know, > the following equalities should hold: > > (*>) = (>>) > > f *> empty = empty IO already fails at this law, because (f *> empty) is not the same as empty,

Re: [Haskell-cafe] Alternative IO

2009-07-10 Thread Sterling Clover
On Jul 10, 2009, at 4:35 AM, Wolfgang Jeltsch wrote: I fear that this instance doesn’t satisfy required laws. As far as I know, the following equalities should hold: (*>) = (>>) f *> empty = empty empty <|> g = g This implies the following: (f >> empty) <|> g = g But th

Re: [Haskell-cafe] Problems with nested Monads

2009-07-10 Thread Job Vranish
Yeah, I think the problem with my case is that while M is a specific monad (essentially StateT), N can be an arbitrary monad, which I think destroys my changes of making a valid joinInner/joinOuter/distribute. Maybe someday Haskell will infer valid joinInner/joinOuter for simple cases :D Thanks for

Re: [Haskell-cafe] first project. code reviews?

2009-07-10 Thread Jason Dagit
On Fri, Jul 10, 2009 at 2:08 PM, Jared Jennings wrote: > I've written a parser for OFX 1.x (these are the files you can > download from most banks detailing recent account activity). > > I'm not sure I've written it well. This is my first serious thing in > Haskell. At a quick glance I can give

Re: [Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-10 Thread Johan Tibell
On Fri, Jul 10, 2009 at 9:51 PM, Marc Weber wrote: > (I wrote this two days ago.. unfortunately I missed that my new client > didnt't sent it at all) > > Not wasting so much space on top for wiki space > +1 > > competition to get a new design: > +1, but is it feasable? Is there enough man power t

[Haskell-cafe] first project. code reviews?

2009-07-10 Thread Jared Jennings
I've written a parser for OFX 1.x (these are the files you can download from most banks detailing recent account activity). I'm not sure I've written it well. This is my first serious thing in Haskell. (Kudos to the writers of the guide for how to make a new Hackage project! It's brilliant.) htt

Re: [Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-10 Thread Don Stewart
One issue no one has raised yet is how to integrate this with MediaWiki. First we'd need to upgrade our mediawiki instance (which means moving to a new server), and then we'd need a template for the front page with these design features. Someone want to step up to lead such an effort? -- Don ma

[Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-10 Thread Marc Weber
(I wrote this two days ago.. unfortunately I missed that my new client didnt't sent it at all) Not wasting so much space on top for wiki space +1 competition to get a new design: +1, but is it feasable? Is there enough man power to implement it? Moving wiki content again? This is much mor

Re: [Haskell-cafe] Problems with nested Monads

2009-07-10 Thread Edward Kmett
The problem you have is that monad composition isn't defined in general. You would need some form of distributive law either for your monads in general, or for your particular monads wrapped around this particular kind of value. What I would look for is a function of the form of one of: distribut

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-10 Thread Don Stewart
tom.davie: > > On 9 Jul 2009, at 18:32, Thomas ten Cate wrote: > >> Are there any kind of hard statistics and analytics that we can base >> this discussion upon? There is always room for improvement, but >> stumbling around in the dark making blind guesses may not be the best >> way to go. Although

[Haskell-cafe] Problems with nested Monads

2009-07-10 Thread Job Vranish
I'm trying to make a function that uses another monadic function inside a preexisting monad, and I'm having trouble. Basically my problem boils down to this. I have three monadic functions with the following types: f :: A -> M B g :: B -> N C h :: C -> M D (M and N are in the monad class) I want a

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-10 Thread Richard Kelsall
Jeff Wheeler wrote: ... Search that follows it is awkward. There are three large search choices for beginners: 1) the search at the top, which confusingly has two submit buttons (with ambiguous differences to a beginner); 2) the Search link near the top of the navigation (which links to an almost

Re: [Haskell-cafe] Re: Laziness enhances composability: an example

2009-07-10 Thread Marcin Kosiba
On Friday 10 July 2009, Gleb Alexeyev wrote: > Marcin Kosiba wrote: > > Hi, > > To illustrate what I meant I'm attaching two examples. In example_1.py > > I've written code the way I think would be elegant (but it doesn't work). > > In example_2.py I've written code so that it works, but it isn

Re: [Haskell-cafe] Colour tutorial (Was: AC-Vector, AC-Colour and AC-EasyRaster-GTK)

2009-07-10 Thread Dougal Stanton
On Fri, Jul 10, 2009 at 6:42 AM, wrote: > On Thu, 9 Jul 2009, rocon...@theorem.ca wrote: > >> You can use by lib without worrying about the CIE.  You can use my library >> without ever importing or using the word CIE.  However, the CIE stuff is >> there for those who need it. >> >> Perhaps I (mayb

[Haskell-cafe] Mixing C and Haskell code in the same file

2009-07-10 Thread Maurí­cio
Is it possible to insert C code directly to, say, .hsc files? I see this construct in ghc user docs: #def ... which should insert definitions, but I could not find examples of usage in Hackage. My goal is to write some cpp macros that build both a C function and its 'foreign import ccall' wrappe

Re: [Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread Thomas ten Cate
I ran a little experiment of my own, using a GHC HEAD build of a week or so ago. Here's a hex dump of my test source, so that we can see that it's really UTF-8. $ od -xc Test.hs 000 6f6d 7564 656c 4d20 6961 206e 6877 7265 m o d u l e M a i n w h e r

[Haskell-cafe] Re: Laziness enhances composability: an example

2009-07-10 Thread Gleb Alexeyev
Marcin Kosiba wrote: Hi, To illustrate what I meant I'm attaching two examples. In example_1.py I've written code the way I think would be elegant (but it doesn't work). In example_2.py I've written code so that it works, but it isn't elegant. I know I'm abusing Python iterators here. Also, I

Re: [Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread david48
On Fri, Jul 10, 2009 at 10:55 AM, Magnus Therning wrote: > On Fri, Jul 10, 2009 at 8:54 AM, david48 wrote: > Not that I have any hope of being able to answer your question, but I > think it might be useful if you informed us _where_ the characters are > mangled.  Is it when you view it in a browse

Re: [Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread Khudyakov Alexey
On Пятница 10 июля 2009 12:55:46 Magnus Therning wrote: > Not that I have any hope of being able to answer your question, but I > think it might be useful if you informed us where the characters are > mangled. Is it when you view it in a browser, or when you open the > Haddock-generated HTML files

Re: [Haskell-cafe] Alternative IO

2009-07-10 Thread Cristiano Paris
On Fri, Jul 10, 2009 at 10:35 AM, Wolfgang Jeltsch wrote: > ... > Hello Cristiano, > > I fear that this instance doesn’t satisfy required laws. As far as I know, the > following equalities should hold: > >    (*>) = (>>) > >    f *> empty = empty > >    empty <|> g = g > > This implies the followin

Re: [Haskell-cafe] Laziness enhances composability: an example

2009-07-10 Thread Cristiano Paris
2009/7/9 Marcin Kosiba : > On Thursday 09 July 2009, Cristiano Paris wrote: >> Thanks. In fact, I was stuck trying to find an example which couldn't >> be written using Python's iterators. The only difference coming up to >> my mind was that Haskell's lists are a more natural way to express a >> pr

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-10 Thread Robin Green
On Fri, 10 Jul 2009 10:44:51 +0200 Wolfgang Jeltsch wrote: > PASCAL > uses “program”, not “programme”, The word program (as in computer program) is spelled program in both British and American English. -- Robin ___ Haskell-Cafe mailing list Haskell-Ca

Re: [Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread Magnus Therning
On Fri, Jul 10, 2009 at 8:54 AM, david48 wrote: > Hello all, > > I made a small program for my factory and I wanted to try to document > it using haddock. The thing is, the comments are in French and the > resulting html pages are unreadable because the accentuated letters > are mangled. > > It's n

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-10 Thread Wolfgang Jeltsch
Am Freitag, 10. Juli 2009 05:26 schrieb rocon...@theorem.ca: > I find it amazing that you independently chose to spell colour with a `u'. > It makes me feel better about my choice. I have to admit that it makes me unhappy. :-( Why do we use English for identifiers? Because English is the languag

Re: [Haskell-cafe] Alternative IO

2009-07-10 Thread Wolfgang Jeltsch
Am Donnerstag, 9. Juli 2009 15:27 schrieb Cristiano Paris: > As a joke, I wrote an instance of Alternative for IO actions: > {-# LANGUAGE ScopedTypeVariables #-} > module Main where > > import Control.Applicative > import Control.Exception > > instance Alternative IO where > empty = undefined >

[Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread david48
Hello all, I made a small program for my factory and I wanted to try to document it using haddock. The thing is, the comments are in French and the resulting html pages are unreadable because the accentuated letters are mangled. It's not acceptable to use HTML entities, as I'd like the comments t

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-10 Thread Tom Lokhorst
> We could even have a "featured package" section... I like that idea! If there's a blog or something (the contents of which are automatically pulled into the wiki/site), then there could be a guest writer each month to write a short post about their favorite (or their own ;-) package on hackage.

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-10 Thread minh thu
2009/7/10 Thomas Davie : > > On 9 Jul 2009, at 18:32, Thomas ten Cate wrote: > >> Are there any kind of hard statistics and analytics that we can base >> this discussion upon? There is always room for improvement, but >> stumbling around in the dark making blind guesses may not be the best >> way t