[Haskell-cafe] HXT: Replace an element with its text

2012-06-25 Thread Michael Orlitzky
I would like to replace, foo with, foo using HXT. So far, the closest I've come is to parse the HTML and apply the following stuff: is_link :: (ArrowXml a) => a XmlTree XmlTree is_link = hasName "a" replace_links_with_their_text :: (ArrowXml a) => a XmlTree XmlTree replace_lin

Re: [Haskell-cafe] Hackage 2 maintainership

2012-06-25 Thread Jeremy Shaw
On Wed, Jun 20, 2012 at 11:06 AM, Ben Gamari wrote: > This list is definitely a start. One of the issues that was also > realized is the size of the server's memory footprint. Unfortunately > acid-state's requirement that all data either be in memory or have no > ACID guarantees was found to be a

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-25 Thread MightyByte
Jonathan Geddes gmail.com> writes: > Cafe, > > I was watching a panel on languages[0] recently and Martin Odersky (the creator of Scala) said something about Monads: > > > "What's wrong with Monads is that if you go into a Monad you have to change your whole syntax from scratch. Every single

Re: [Haskell-cafe] Unambiguous choice implementation

2012-06-25 Thread Bartosz Milewski
Thanks, Heinrich. I looked at the examples and at the references you provided. I understand the semantic model, so I guess I'm mostly trying to understand the implementation. Conal's paper was mostly about refining data structures in order to provide better implementation. It's all beautiful up to

[Haskell-cafe] Munich Haskell Meeting

2012-06-25 Thread Heinrich Hördegen
Dear all, once again, we want to invite you to our monthly Munich Haskell Meeting at Thu, 28th of June, at 19h30. This time, the venue will be Max Emanuell Brauerei in Munich (http://www.max-emanuel-brauerei.de/). Be aware of that change! Thursday will also be the day of a local football pl

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-25 Thread Ernesto Rodriguez
Well, Monads are something optional at the end. Even the IO Monad is an optional pattern with unsafePerformIO, but we use it because one of the reasons we love Haskell is it's ability to differentiate pure and impure functions. But sadly this is one of the traits we love about Haskell but others d

Re: [Haskell-cafe] ghci session slows down over time.

2012-06-25 Thread Jonathan Geddes
Thanks for the responses. I am using GHC 7.4.1 an Ubuntu. Shutting down and restarting ghci is my current workaround. I was hoping for something a bit less disruptive. :kickoffGC or something like that. --J Arthur On Mon, Jun 25, 2012 at 6:54 AM, Ketil Malde wrote: > Jonathan Geddes writes

[Haskell-cafe] Galois is hiring!

2012-06-25 Thread Jason Dagit
We're looking for functional programmers, formal methods practitioners, and project leads, interested in either short term or permanent employment. For more information, see: http://corp.galois.com/careers Why Galois? At Galois, we believe in seeking out and solving important problems to make

Re: [Haskell-cafe] Origin of Delimited Continuation Operators

2012-06-25 Thread Stephen Tetley
On 25 June 2012 18:02, Stephen Tetley wrote: > Shift for instance is referenced back to at least Davy and Filinski's > "Abstracting Control" 1990. Typo - Olivier _Danvy_ not "Davy" ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.hask

Re: [Haskell-cafe] Origin of Delimited Continuation Operators

2012-06-25 Thread Stephen Tetley
You could try working back from the references in Dorai Sitaram's "Handling Control" 1993, which is an important paper in the Scheme community covering this area. http://www.cs.rice.edu/CS/PLT/Publications/Scheme/pldi93-s.ps.gz Shift for instance is referenced back to at least Davy and Filinski's

Re: [Haskell-cafe] ghci session slows down over time.

2012-06-25 Thread Ketil Malde
Jonathan Geddes writes: > Is this a known issue? More importantly, is there a known workaround? My experience is that ghci (typically run as an inferior Emacs process) often retains a lot of memory. Thus, I occasionally kill and restart it. (Not sure if that counts as a workaround :-) -k -- I

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-25 Thread Alberto G. Corona
My pocket explanation: While e a function gives one only value of the codomain for each element of the domain set (and thus it can be evaluated a single time), a category is a generalization that accept many graphs that goes from each element of the domain to the codomain. For that matter getChar

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Ivan Lazar Miljenovic
On 25 June 2012 20:00, Magicloud Magiclouds wrote: > Even more weird, I installed container-0.5.0.0, and now it just compiled! > I will dig more of that. Sorry to bother you guys. Possibly your Magiclouds module was using a different version of containers or something? *shrug* > > On Mon, Jun 25

Re: [Haskell-cafe] not enough fusion?

2012-06-25 Thread Duncan Coutts
On 25 June 2012 02:04, Johannes Waldmann wrote: > Dear all, > > while doing some benchmarking (*) > I noticed that function  s1  is considerably faster than  s2 > (but I wanted  s2  because it looks more natural) > (for n = 1,  s1 takes 20 s, s2 takes 13 s; compiled by ghc-7.4.2 -O2) > > s1 ::

Re: [Haskell-cafe] not enough fusion?

2012-06-25 Thread Lorenzo Bolla
You are right, probably I didn't because I cannot reproduce it now. Sorry for the noise. (Anyway, I am still surprised that list-comprehension gives a different result from do-notation in the list monad.) L. On Mon, Jun 25, 2012 at 11:55 AM, Dmitry Olshansky wrote: > In my test it works ~20% f

Re: [Haskell-cafe] not enough fusion?

2012-06-25 Thread Dmitry Olshansky
In my test it works ~20% faster than s2 and ~20% slower than s1. Did you use -O2 flag? 2012/6/25 Lorenzo Bolla > I wonder why this performs really badly, though (I would expect it to be > the same as s2): > > s3 :: Int -> Int > s3 n = sum [gcd x y | x <- [ 0 .. n-1 ], y <- [ 0 .. n-1 ]] > > From

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Arlen Cuss
Glad you worked it out! :) Usually isolating the part of concern in a mysterious error will help shed light on the source! Cheers, Arlen On Monday, 25 June 2012 at 8:00 PM, Magicloud Magiclouds wrote: > Even more weird, I installed container-0.5.0.0, and now it just compiled! > I will dig m

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Magicloud Magiclouds
Even more weird, I installed container-0.5.0.0, and now it just compiled! I will dig more of that. Sorry to bother you guys. On Mon, Jun 25, 2012 at 5:53 PM, Magicloud Magiclouds wrote: > Interesting, seems like mapM did not effect the problem > Let me try more with the first argument of mapM

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Magicloud Magiclouds
Interesting, seems like mapM did not effect the problem Let me try more with the first argument of mapM On Mon, Jun 25, 2012 at 5:04 PM, Arlen Cuss wrote: > Magicloud, > > Try to reduce the particular problem you're having to the smallest possible > example that reproduces the issue. Non

Re: [Haskell-cafe] not enough fusion?

2012-06-25 Thread Lorenzo Bolla
I wonder why this performs really badly, though (I would expect it to be the same as s2): s3 :: Int -> Int s3 n = sum [gcd x y | x <- [ 0 .. n-1 ], y <- [ 0 .. n-1 ]] >From the links posted by Dmitry, it might be that the code generated is made of 2 recursive calls: in fact, what I observe is a "

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Magicloud Magiclouds
Sorry, I forgot that. Magicloud.Map.mapM sure is a helper I use as lifted Data.Map.map. If I changed the type of the result of start, the Jobs module compiled. But still cannot compile with the other module (which uses start). And the error is on JobArgs. I post the function here, I am not sure how

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Ivan Lazar Miljenovic
On 25 June 2012 19:04, Arlen Cuss wrote: > Magicloud, > > Try to reduce the particular problem you're having to the smallest possible > example that reproduces the issue. None of us can compile your code, either, > because we're missing many of the dependencies, and unfortunately the issue > is

Re: [Haskell-cafe] not enough fusion?

2012-06-25 Thread Dmitry Olshansky
s1 ~ sum $ map (sum . flip map [0..n] . gcd) [0..n] s2 ~ sum $ concatMap (flip map [0..n] . gcd) [0..n] There are some posts from Joachim Breitner investigated fusion for concatMap: http://www.haskell.org/pipermail/haskell-cafe/2011-December/thread.html#97227 2012/6/25 Johannes Waldmann > Dea

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Arlen Cuss
Magicloud, Try to reduce the particular problem you're having to the smallest possible example that reproduces the issue. None of us can compile your code, either, because we're missing many of the dependencies, and unfortunately the issue is no easier (for me) to track down with the full sourc

Re: [Haskell-cafe] Unambiguous choice implementation

2012-06-25 Thread Heinrich Apfelmus
Bartosz Milewski wrote: I'm trying to understand Reactive Banana, but there isn't much documentation to go about. I haven't written any beginner documentation yet because the API is still in flux. The homepage http://www.haskell.org/haskellwiki/Reactive-banana and Stackoverflow http://

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Magicloud Magiclouds
Here is the code, I joined two modules in one paste. Both of them cannot pass compiling. http://hpaste.org/70418 On Mon, Jun 25, 2012 at 2:16 PM, Ivan Lazar Miljenovic wrote: > On 25 June 2012 12:50, Magicloud Magiclouds > wrote: >> Hi, >>  There was another mail, but the subject might be confu

[Haskell-cafe] ICFP Student Research Competition

2012-06-25 Thread Wouter Swierstra
= Student Research Competition Associated with the The 17th ACM SIGPLAN International Conference on Functional Programming (ICFP 2012) and

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-25 Thread Anton Kholomiov
The class you're looking for is Applicative. The (<*>) operator handles application of "effectful" things to "effectful" things, whereas (<$>) handles the application of non-"effectful" things to "effectful" things. This situation is interesting because it highlights the fact that there is a distin