Re: [Haskell-cafe] The maximum/minimum asymmetry

2011-09-04 Thread Alexander Dunlap
On 4 September 2011 21:44, Mario Blažević wrote: >    I was recently surprised to discover that the maximum and maximumBy > functions always return the *last* maximum, while minimum and minimumBy > return the *first* minimum in the list. The following GHCi session > demonstrates this: > > $ ghci >

[Haskell-cafe] The maximum/minimum asymmetry

2011-09-04 Thread Mario Blažević
I was recently surprised to discover that the maximum and maximumBy functions always return the *last* maximum, while minimum and minimumBy return the *first* minimum in the list. The following GHCi session demonstrates this: $ ghci GHCi, version 7.2.1: http://www.haskell.org/ghc/ :? for

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Sebastian Fischer
These are important questions. I think there is a trade-off between supporting many cases and having a simple desugaring. We should find a sweet-spot where the desugaring is reasonably simple and covers most idiomatic cases. So I guess it's possible to detect the pattern: > > do x1 <- foo1; ...;

[Haskell-cafe] Call for papers: Programming languages meets program verification

2011-09-04 Thread Nikhil Swamy
PLPV 2012 The Sixth ACM SIGPLAN Workshop Programming Languages meets Program Verification 24th January, 2012 Philadelphia, USA (Affiliated with POPL 2012) http://research.microsoft.com/en-us/um/people/nswamy/plpv12 --

[Haskell-cafe] Final CFP: PADL'12 - Practical Aspects of Declarative Languages 2012

2011-09-04 Thread Claudio Russo
[Apologies if you receive multiple copies.] Final Call for Papers = 14th International Symposium on Practical Aspects of Declarative Languages (PADL 2012) http://research

[Haskell-cafe] EclipseFP fails to install

2011-09-04 Thread Henk-Jan van Tuyl
L.S., I have installed Eclipse 3.7 and EclipseFP 2.1.0 on my Windows XP computer After trying to install EclipseFP in Eclipse, I got the following message: C:\Programs\Haskell Platform\2011.2.0.1\bin\ghc-pkg.exe dump --global cabal.0.6.0.exe: failed to parse output of 'ghc-pkg dump' What ca

Re: [Haskell-cafe] Real CMS Application in Haskell

2011-09-04 Thread Alistair Bayley
On 4 September 2011 17:46, Haisheng Wu wrote: > Hello guys, >   I googled for a real open source CMS application in Haskell but have no > luck. >   So I'm wondering if Haskell is used very little in Web development area. > Thanks. > -Simon There was this, quite some time ago: http://article.gma

Re: [Haskell-cafe] Enumeratee that generates data

2011-09-04 Thread Gregory Collins
On Sun, Sep 4, 2011 at 7:09 PM, tsuraan wrote: >> For this specific problem I recommend using a forkIO'd >> Iteratee/Enumerator pair with a Chan to shuttle data between them, I >> think it's probably the best way of doing it. > > Googling for "enumerator chan" gives me this gist (written by you in

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Daniel Peebles
Yeah, I use SHE and her idiom brackets for several of my projects, but there are many cases in which they're awkward too. Another consideration about the "monad" comprehensions is that unbound (i.e., with no <-) statements in a monad comprehension are treated as MonadPlus guards, so the applicativ

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Dan Doel
On Sun, Sep 4, 2011 at 12:24 AM, Ivan Lazar Miljenovic wrote: > On 4 September 2011 12:34, Daniel Peebles wrote: >> Hi all, >> For example, if I write in a do block: >> x <- action1 >> y <- action2 >> z <- action3 >> return (f x y z) >> that doesn't require any of the context-sensitivty that Mona

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Dominique Devriese
It's not the same as what you propose, but it's related, so for discussion, I just want to point out idiom brackets (an analog for do-notation for Applicative functors) which have been introduced in some Haskell-related languages. Examples are Idris (http://www.cs.st-andrews.ac.uk/~eb/Idris/donotat

Re: [Haskell-cafe] Enumeratee that generates data

2011-09-04 Thread tsuraan
> For this specific problem I recommend using a forkIO'd > Iteratee/Enumerator pair with a Chan to shuttle data between them, I > think it's probably the best way of doing it. Googling for "enumerator chan" gives me this gist (written by you in April): https://gist.github.com/932384 . Is that wha

Re: [Haskell-cafe] Enumeratee that generates data

2011-09-04 Thread Gregory Collins
On Sun, Sep 4, 2011 at 6:03 PM, tsuraan wrote: > Is my basic model broken here?  It's occurred to me that what I > actually want to do is tie the enumSocket clientSock to an iterSocket > upstreamSock, do the reverse, and then do two runIteratee calls (one > in a forkIO, I guess?).  That seems ugli

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Thomas Schilling
I don't quite understand how this would work. For example, would it work for these examples? do x <- blah let foo = return foo (f x) -- Using an alias of return/pure do x <- Just blah Just (f x) -- another form of aliasing do x <- blah return (g x x) -- could perhap

[Haskell-cafe] Enumeratee that generates data

2011-09-04 Thread tsuraan
I'm trying to write a program whose network behaviour is analogous to a web proxy. A client connects to my server and gives me some data, my server connects to an upstream server and gives data to it, my server gets data from upstream, and gives data to the client. I'd like to write this using th

[Haskell-cafe] ANNOUNCE: Hs2lib-0.5.5

2011-09-04 Thread Phyx
What is it? A preprocessor and library which allow you to create dynamic libs from arbitrary annotated Haskell programs with one click. It also allows you to use the generated lib in C, C++ and C# just by including the generated header files. At a minimum it can be considered the inverse

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Sebastian Fischer
On Sun, Sep 4, 2011 at 11:34 AM, Daniel Peebles wrote: > I was wondering what people thought of a smarter do notation. I'd support it (for both do notation and monad comprehensions) once Applicative is a superclass of Monad. To me it looks light a slight complication for an advantage. Parsers ar

Re: [Haskell-cafe] Idiomatic usage of the fixpoint library

2011-09-04 Thread Roman Cheplyaka
* Sean Leather [2011-09-04 12:48:38+0200] > On Sun, Sep 4, 2011 at 12:31, Roman Cheplyaka wrote: > > > I'm looking for an example of idiomatic usage of the fixpoint library[1]. > > > > [1]: http://hackage.haskell.org/package/fixpoint-0.1.1 > > > I'm not sure if this counts for idiomatic usage,

Re: [Haskell-cafe] Real CMS Application in Haskell

2011-09-04 Thread Haisheng Wu
It's being great than those frameworks getting popular and mature. Initially what I expect is something similar toJoomla! in PHP or Refinery CMS in Ruby than allow us to quick start a CMS application. And I'm not such experienced at Haskel to build a one on my own. :( Thanks. -Haisheng On Sun,

Re: [Haskell-cafe] Idiomatic usage of the fixpoint library

2011-09-04 Thread Sean Leather
On Sun, Sep 4, 2011 at 12:31, Roman Cheplyaka wrote: > I'm looking for an example of idiomatic usage of the fixpoint library[1]. > > [1]: http://hackage.haskell.org/package/fixpoint-0.1.1 I'm not sure if this counts for idiomatic usage, but you can check out our approach to incrementalization.

[Haskell-cafe] Idiomatic usage of the fixpoint library

2011-09-04 Thread Roman Cheplyaka
Hi, I'm looking for an example of idiomatic usage of the fixpoint library[1]. [1]: http://hackage.haskell.org/package/fixpoint-0.1.1 Here's what I managed to get: {-# LANGUAGE TypeFamilies, FlexibleContexts, UndecidableInstances, FlexibleInstances #-} import Data.Fixpoint newtype

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Daniel Peebles
Good idea! I'd forgotten about monad comprehensions. On Sun, Sep 4, 2011 at 3:11 AM, Shachaf Ben-Kiki wrote: > On Sat, Sep 3, 2011 at 19:34, Daniel Peebles wrote: > ... > > Of course, the fact that the return method is explicitly mentioned in my > > example suggests that unless we do some real

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Shachaf Ben-Kiki
On Sat, Sep 3, 2011 at 19:34, Daniel Peebles wrote: ... > Of course, the fact that the return method is explicitly mentioned in my > example suggests that unless we do some real voodoo, Applicative would have > to be a superclass of Monad for this to make sense. But with the new default > supercla