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 backtra

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 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 'cut' operato

[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 poin

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

2010-06-29 Thread Ivan Lazar Miljenovic
Chris BROWN 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 suitable for HaRe?

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

2010-06-29 Thread Roman Beslik
On 29.06.10 08:37, Ketil Malde wrote: Albert Y.C.Lai writes: The doc of deleteBy states: "The deleteBy function behaves like delete, but takes a user-supplied equality predicate." A precondition is that the user-supplied predicate is an equality predicate. (>=) is not an equality predicate, be

[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 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; the same goes for

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 Exc

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

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

2010-06-29 Thread Roman Cheplyaka
* Vo Minh Thu [2010-06-29 16:26:06+0200] > 2010/6/29 Roman Cheplyaka : > > * Stephen Tetley [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: >

[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 script

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 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 c

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

2010-06-29 Thread Ivan Lazar Miljenovic
Chris BROWN 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 the future, and

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

2010-06-29 Thread Vo Minh Thu
2010/6/29 Roman Cheplyaka : > * Stephen Tetley [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

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

2010-06-29 Thread Roman Cheplyaka
* Stephen Tetley [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 the point, bu

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 bui

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

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

2010-06-29 Thread Ivan Lazar Miljenovic
Daniel Fischer 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" (if it was fixe

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 Haskell

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 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

[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

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 wou

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

2010-06-29 Thread Ivan Lazar Miljenovic
Daniel Fischer 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? That's like asking wh

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) intent

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

2010-06-29 Thread Ketil Malde
Daniel Fischer 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 much non-sensical code

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

2010-06-29 Thread Ivan Lazar Miljenovic
Ketil Malde writes: > Max Rabkin 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 question why that design decision

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

2010-06-29 Thread Ketil Malde
Max Rabkin 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 giants _

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

2010-06-29 Thread Ivan Lazar Miljenovic
Max Rabkin writes: > On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde 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

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 Max Rabkin
On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde 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 . not), is

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

2010-06-29 Thread Ketil Malde
Daniel Fischer 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 that it ought to be

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

2010-06-29 Thread Ivan Lazar Miljenovic
Sebastian Fischer 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 problems with

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 th

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"

[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 >

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 wrote: > 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

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 App

[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 in