Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Edward Z. Yang
Excerpts from Albert Y.C.Lai's message of Mon Jun 28 15:44:34 -0400 2010: I propose that at each minor version of base, someone picks an implementation randomly. This has actually been done, in a legitimate language implementation. Check out:

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Lars Viklund
On Mon, Jun 28, 2010 at 07:44:34PM +, Albert Y.C.Lai wrote: I propose that at each minor version of base, someone picks an implementation randomly. Here is a more radical, less labour-intensive solution, if you don't mind a judicious, correctness-preserving use of unsafePerformIO: at the

[Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Sebastian Fischer
Hello Chris, Chris Brown wrote: we are pleased to announce the availability of HaRe 0.6 Great, I want to try it! While skimming the installation instructions I wondered why I couldn't just do cabal install HaRe Are there any problems with putting HaRe on Hackage? I will probably

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Stephen Tetley
Hi Michael If you going to the trouble of constructing a sum type (obliged to be 2 parameter) expressly to play well with the favourite single parameter classes e.g. Functor/ Applicative / Monad [*], maybe it is worth considering new names for the type and its constructors relating to what the

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Michael Snoyman
On Tue, Jun 29, 2010 at 10:18 AM, Stephen Tetley stephen.tet...@gmail.comwrote: Hi Michael If you going to the trouble of constructing a sum type (obliged to be 2 parameter) expressly to play well with the favourite single parameter classes e.g. Functor/ Applicative / Monad [*], maybe it is

[Haskell-cafe] Re: specifying package name in ghci import?

2010-06-29 Thread Maciej Piechotka
On Mon, 2010-06-28 at 19:29 -0700, Michael Vanier wrote: Hi, Quick question about ghci: when I do this at the prompt: ghci :m +Control.Monad.Cont I get Ambiguous module name `Control.Monad.Cont': it was found in multiple packages: mtl-1.1.0.2 monads-fd-0.0.0.1 Is there

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Zura_
Maybe it is because deleteBy is defined wrongly? i.e. it is not logical, doesn't follow the common sense user might expect. It accepts any predicate but narrows requirements only in docs. Maybe best could be to just take a value for comparison and use == against it? (overloaded or built-in (I'm

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Daniel Fischer
On Tuesday 29 June 2010 10:47:40, Zura_ wrote: Maybe it is because deleteBy is defined wrongly? i.e. it is not logical, doesn't follow the common sense user might expect. It accepts any predicate but narrows requirements only in docs. Unfortunately, you can't easily encode the requirement that

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Ivan Lazar Miljenovic
Sebastian Fischer s...@informatik.uni-kiel.de writes: Hello Chris, Chris Brown wrote: we are pleased to announce the availability of HaRe 0.6 Great, I want to try it! While skimming the installation instructions I wondered why I couldn't just do cabal install HaRe Are there any

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: Maybe it is because deleteBy is defined wrongly? i.e. it is not logical, doesn't follow the common sense user might expect. It accepts any predicate but narrows requirements only in docs. Unfortunately, you can't easily encode the requirement

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Max Rabkin
On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde ke...@malde.org wrote:  deleteBy :: (a - Bool) - [a] - [a] I don't think there would be any doubt what 'deleteBy (= 5) [1..10]' would do. And I just don't see what the requirement for an equivalence relation buys you. Your deleteBy is (filter .

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Daniel Fischer
On Tuesday 29 June 2010 11:46:47, Ketil Malde wrote: An important point of a powerful type system is to model your program so that only sensible code is legal. That would be an awesomely powerful type system :) This makes me wonder why deleteBy is defined so loosely, instead of e.g.

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ivan Lazar Miljenovic
Max Rabkin max.rab...@gmail.com writes: On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde ke...@malde.org wrote:  deleteBy :: (a - Bool) - [a] - [a] I don't think there would be any doubt what 'deleteBy (= 5) [1..10]' would do. And I just don't see what the requirement for an equivalence

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Max Rabkin max.rab...@gmail.com writes: Your deleteBy is (filter . not), isn't it? With the caveat that I haven't actually used it, my impression is that delete only removes one element, while filter removes all of them. -k -- If I haven't seen further, it is by standing in the footprints of

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ivan Lazar Miljenovic
Ketil Malde ke...@malde.org writes: Max Rabkin max.rab...@gmail.com writes: Your deleteBy is (filter . not), isn't it? With the caveat that I haven't actually used it, my impression is that delete only removes one element, while filter removes all of them. At most one element, yes; I

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ketil Malde
Daniel Fischer daniel.is.fisc...@web.de writes: An important point of a powerful type system is to model your program so that only sensible code is legal. That would be an awesomely powerful type system :) Heh. But while we're waiting for it, we can try to use what we got to eliminate as

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Daniel Fischer
On Tuesday 29 June 2010 12:46:21, Ivan Lazar Miljenovic wrote: At most one element, yes; I question why that design decision was made as I'm more likely to want to delete all values rather than just the first one That's more common, yes (I don't remember ever having used delete(By)

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ivan Lazar Miljenovic
Daniel Fischer daniel.is.fisc...@web.de writes: That's more common, yes (I don't remember ever having used delete(By) intentionally). But we've filter for that, so it wouldn't make sense to give delete(By) the same semantics. Hence, if you provide both names, what else could deleteBy do?

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Stephen Tetley
Hi Michael Good names are a problem of course. The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK a | Failed err The names are nice and to the point, but they would

[Haskell-cafe] Re: whine and solution about programmers not respecting documentations

2010-06-29 Thread Christian Maeder
Ketil Malde schrieb: [...] I don't think there would be any doubt what 'deleteBy (= 5) [1..10]' would do. Well, if you don't know about filter, you could think it deletes all elements satisfying the predicate, but apart from that, it's clear. I'd probably call it 'filter1', but that's just

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Daniel Fischer
On Tuesday 29 June 2010 12:50:34, Ketil Malde wrote: Daniel Fischer daniel.is.fisc...@web.de writes: An important point of a powerful type system is to model your program so that only sensible code is legal. That would be an awesomely powerful type system :) Heh. But while we're

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Daniel Fischer
On Tuesday 29 June 2010 13:02:20, Ivan Lazar Miljenovic wrote: That's like asking why we have mapM and forM, etc. Yes, why? (okay, I use forM too, it's so much more readable with a short list and a long action) ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] whine and solution about programmers not respecting documentations

2010-06-29 Thread Ivan Lazar Miljenovic
Daniel Fischer daniel.is.fisc...@web.de writes: On Tuesday 29 June 2010 13:02:20, Ivan Lazar Miljenovic wrote: That's like asking why we have mapM and forM, etc. Yes, why? (okay, I use forM too, it's so much more readable with a short list and a long action) Exactly; using deleteBy p

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Chris BROWN
Hi Sebastian, Great, I want to try it! Thanks for you interest! While skimming the installation instructions I wondered why I couldn't just do cabal install HaRe Are there any problems with putting HaRe on Hackage? I've looked at this before and I must say it's certainly not

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Chris BROWN
Hi Ivan, I've tried playing with an older version of HaRe; it's build system is a little weird but I'm sure it can be converted into a Cabal-compatible format. Part of the problem if memory serves is the use of embedded libraries that aren't on Hackage either. That's correct. HaRe builds

[Haskell-cafe] Error monads (was: Call for comments: neither package)

2010-06-29 Thread Roman Cheplyaka
* Stephen Tetley stephen.tet...@gmail.com [2010-06-29 12:02:45+0100] The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK a | Failed err The names are nice and to

Re: [Haskell-cafe] Error monads (was: Call for comments: neither package)

2010-06-29 Thread Vo Minh Thu
2010/6/29 Roman Cheplyaka r...@ro-che.info: * Stephen Tetley stephen.tet...@gmail.com [2010-06-29 12:02:45+0100] The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Ivan Lazar Miljenovic
Chris BROWN chr...@cs.st-andrews.ac.uk writes: Of course, it would also be nice if HaRe could parse more than just Haskell98... :p (I know, I know, it isn't easy to change parsers, etc.). HaRe works over the full Haskell 98 standard. We certainly wish to move HaRe over to GHC Haskell in

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Chris BROWN
On 29 Jun 2010, at 15:55, Ivan Lazar Miljenovic wrote: Chris BROWN chr...@cs.st-andrews.ac.uk writes: Of course, it would also be nice if HaRe could parse more than just Haskell98... :p (I know, I know, it isn't easy to change parsers, etc.). HaRe works over the full Haskell 98

[Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Sebastian Fischer
Chris Brown wrote: Are there any problems with putting HaRe on Hackage? I've looked at this before and I must say it's certainly not trivial to do this. [...] We also need to have vim and emacs scripts available to the user after the install. The ghc-mod package [1] provides emacs

Re: [Haskell-cafe] Error monads (was: Call for comments: neither package)

2010-06-29 Thread Roman Cheplyaka
* Vo Minh Thu not...@gmail.com [2010-06-29 16:26:06+0200] 2010/6/29 Roman Cheplyaka r...@ro-che.info: * Stephen Tetley stephen.tet...@gmail.com [2010-06-29 12:02:45+0100] The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Jeremy Shaw
On Jun 29, 2010, at 6:02 AM, Stephen Tetley wrote: Hi Michael Good names are a problem of course. The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK a | Failed err

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Ross Paterson
On Tue, Jun 29, 2010 at 02:56:18PM -0500, Jeremy Shaw wrote: On Jun 29, 2010, at 6:02 AM, Stephen Tetley wrote: The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK

[Haskell-cafe] Re: [Haskell] Second draft of the Haskell 2010 report available

2010-06-29 Thread Henk-Jan van Tuyl
On Tue, 29 Jun 2010 17:01:54 +0200, Simon Marlow marlo...@gmail.com wrote: Comments on the draft report are welcome, before I finalise this and sign off on Haskell 2010. Subsection 12.3, Language extensions, mentions the FFI as a language extension, but FFI is now part of the standerd;

Re: [Haskell-cafe] Re: ANNOUNCE: HaRe, the Haskell Refactorer 0.6

2010-06-29 Thread Ivan Lazar Miljenovic
Chris BROWN chr...@cs.st-andrews.ac.uk writes: On 29 Jun 2010, at 15:55, Ivan Lazar Miljenovic wrote: I talked with you and Simon Thompson about this at PEPM, and at the time you said that haskell-src-exts didn't have what you needed for HaRe. What exactly do you need in a parser for it to be

[Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Erik de Castro Lopo
Hi all, I'm reading John Hughes' paper Generalizing Monads to Arrows and found the statement regarding parser combinators: ... depend on the programmer using an additional combinator similar to Prolog's 'cut' operator do declare that a parser need never backtrack beyond a certain point.

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Antoine Latter
On Tue, Jun 29, 2010 at 10:26 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Hi all, I'm reading John Hughes' paper Generalizing Monads to Arrows and found the statement regarding parser combinators:   ... depend on the programmer using an additional combinator similar   to Prolog's

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Erik de Castro Lopo
Antoine Latter wrote: For Parsec, in the absence of the try combinator, a parser will never back-track once it consumes a portion of the input. Thanks for reminding me. If try is pushed out into the leaves of you parser, you shouldn't run in to too much trouble with excessive backtracking.