Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Ivan Lazar Miljenovic
On 25 July 2011 14:31, Mark Spezzano wrote: > Hi Kevin, > > Thanks for the response. The first part works well with minor modifications. > > Part 2 is still a bit vague to me. I basically want to "clamp" the Integers > generated within the Queue to between 0 and some positive number. At present

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Mark Spezzano
Hi Kevin, Thanks for the response. The first part works well with minor modifications. Part 2 is still a bit vague to me. I basically want to "clamp" the Integers generated within the Queue to between 0 and some positive number. At present they're giving me numbers all over the place (specific

Re: [Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?

2011-07-24 Thread August Sodora
Out of (perhaps naive) curiosity, what difficulties does allowing such overriding introduce? Wouldn't the module system prevent the ambiguity of which implementation to use? August Sodora aug...@gmail.com (201) 280-8138 On Sun, Jul 24, 2011 at 11:55 PM, Ivan Lazar Miljenovic wrote: > On 25 Jul

Re: [Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?

2011-07-24 Thread Ivan Lazar Miljenovic
On 25 July 2011 13:50, Sebastien Zany wrote: > I was thinking the reverse. We can already give default implementations of > class operations that can be overridden by giving them explicitly when we > declare instances, so why shouldn't we be able to give default > implementations of operations

Re: [Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?

2011-07-24 Thread Sebastien Zany
I was thinking the reverse. We can already give default implementations of class operations that can be overridden by giving them explicitly when we declare instances, so why shouldn't we be able to give default implementations of operations of more general classes, which could be overridden by

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread wren ng thornton
On 7/24/11 10:09 PM, Sebastian Fischer wrote: >> >> because list is a (the?) free monoid. > > Yes, all free monoids are isomorphic (to lists). > > Sebastian For completeness... The free monoid over a set S is the set of all finite sequences of elements drawn from S. Often this is written with t

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Maciej Marcin Piechotka
On Sun, 2011-07-24 at 19:29 +0100, Julian Porter wrote: > > > > On 24 Jul 2011, at 19:19, KC wrote: > > > I like the following but again "+" denotes addition and not a > > general > > binary operation. > > > > > > > I personally often define the alias: > > > > > > (<+>) = mappend > > > > A

Re: [Haskell-cafe] [Haskell-beginners] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread wren ng thornton
On 7/24/11 2:29 PM, Julian Porter wrote: > On 24 Jul 2011, at 19:19, KC wrote: >> A lot of math books use "+" or "x" enclosed in a circle to indicate >> that the usual meaning of "+" nor "x" is intended for the meaning of >> the binary operation. > > Er no. Both symbols have extremely precise mean

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Sebastian Fischer
> > because list is a (the?) free monoid. Yes, all free monoids are isomorphic (to lists). Sebastian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: Haskell in the Cloud (http://quid2.org)

2011-07-24 Thread Pasqualino "Titto" Assini
Hi David, no there is no direct relationship to distributed haskell. Quid2's focus is not so much on extending Haskell itself and its runtime to work in a distributed fashion but rather to provide a global naming system for functional values. Very similar to the Web, whose main innovation is to

Re: [Haskell-cafe] ANNOUNCE: Haskell in the Cloud (http://quid2.org)

2011-07-24 Thread Pasqualino "Titto" Assini
Hello Sean, thanks for taking the time to road test quid2.org. And believe me, I totally feel your pain :-) I have just started using it in earnest myself (following the great "eat you own dog food" principle) and I know how frustrating the whole experience is. However, I am working on it daily

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Thomas Schilling
> So is the change taking effect? > >> We were approaching consensus for the addition of of: >> infixr 6 <> > >> (<>) :: Monoid m => m -> m -> m >> (<>) = mappend >> and a matching change for (<+>) in the pretty package. > >> It was also suggested to make (<>) a method of Monoid and insert the >>

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Antoine Latter
On Sat, Jul 23, 2011 at 1:41 PM, KC wrote: > It would be easier for beginners to "grok". > I think that assumes that all beginners have a strong foundation in algebra. Although it does have the advantage that the names are as abstract as the class. Antoine > -- > -- > Regards, > KC > > ___

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Chris Smith
On Sun, 2011-07-24 at 21:14 +0900, Maciej Wos wrote: > Personally, I have nothing against mempty (although I agree that mid > makes more sense), but I don't like mappend at all. I wonder what > happened to the idea of using <> instead of mappend (that's what I > always do). I think > > a <> b <> c

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Kevin Quick
On Sun, 24 Jul 2011 07:30:56 -0700, Mark Spezzano wrote: Hi all, I would appreciate it if someone can point me in the right direction with the following problem. I'm deliberately implementing a naive Queues packages that uses finite lists as the underlying representation. I've already

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Thomas Schilling
Yes, this has sort-of been agreed upon in a GHC ticket about a year ago: http://hackage.haskell.org/trac/ghc/ticket/3339 I had a patch in Darcs, but then came the switch to Git. I ported it to Git, but didn't iron out all the issues. That was quite a while ago so it's currently a bit bitrotten.

Re: [Haskell-cafe] [Haskell-beginners] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Julian Porter
On 24 Jul 2011, at 19:19, KC wrote: > I like the following but again "+" denotes addition and not a general > binary operation. > > >> I personally often define the alias: >> >> (<+>) = mappend > > A lot of math books use "+" or "x" enclosed in a circle to indicate > that the usual meaning o

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread KC
I like the following but again "+" denotes addition and not a general binary operation. > I personally often define the alias: > > (<+>) = mappend A lot of math books use "+" or "x" enclosed in a circle to indicate that the usual meaning of "+" nor "x" is intended for the meaning of the binary o

Re: [Haskell-cafe] file splitter with enumerator package

2011-07-24 Thread Eric Rasmussen
Since the program only needs to finish a line after it's made a bulk copy of a potentially large chunk of a file (could be 25 - 500 mb), I was hoping to find a way to copy the large chunk in constant memory and without inspecting the individual bytes/characters. I'm still having some difficulty wit

Re: [Haskell-cafe] file splitter with enumerator package

2011-07-24 Thread Felipe Almeida Lessa
On Sun, Jul 24, 2011 at 12:28 PM, Yves Parès wrote: > If you used Data.Enumerator.Text, you would maybe benefit the "lines" > function: > > lines :: Monad m => Enumeratee Text Text m b It gets arbitrary blocks of text and outputs lines of text. > But there is something I don't get with that sign

Re: [Haskell-cafe] file splitter with enumerator package

2011-07-24 Thread Yves Parès
If you used Data.Enumerator.Text, you would maybe benefit the "lines" function: lines :: Monad m => Enumeratee Text Text m b But there is something I don't get with that signature: why isn't it: lines :: Monad m => Enumeratee Text [Text] m b ?? 2011/7/23 Eric Rasmussen > Hi Felipe, > > Thank

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Yves Parès
Don't forget that some languages use <> to mean "different" (as if "different" meant always "superior or inferior"...), so some beginners might get confused. I personally often define the alias: (<+>) = mappend 2011/7/24 Maciej Wos > Personally, I have nothing against mempty (although I agree

[Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Mark Spezzano
Hi all, I would appreciate it if someone can point me in the right direction with the following problem. I'm deliberately implementing a naive Queues packages that uses finite lists as the underlying representation. I've already read through Hughes' paper and the article in The Fun of Programm

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-24 Thread Maciej Wos
Personally, I have nothing against mempty (although I agree that mid makes more sense), but I don't like mappend at all. I wonder what happened to the idea of using <> instead of mappend (that's what I always do). I think a <> b <> c looks so much better than a `mappend` b `mappend` c and it so

Re: [Haskell-cafe] Github support for cabal files

2011-07-24 Thread Ivan Lazar Miljenovic
On 24 July 2011 21:11, Joris Putcuyps wrote: > On Sat, 23 Jul 2011 19:25:53 -0700 > Greg Weber wrote: > >> I think the haddock description field is a great barrior to >> documentation. I don't want to clutter my cabal file with lengthy >> documentation. Michael Snoyberg and I could not figure out

Re: [Haskell-cafe] Github support for cabal files

2011-07-24 Thread Joris Putcuyps
On Sat, 23 Jul 2011 19:25:53 -0700 Greg Weber wrote: > I think the haddock description field is a great barrior to > documentation. I don't want to clutter my cabal file with lengthy > documentation. Michael Snoyberg and I could not figure out how to > document the Hamlet syntax because there is