Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-28 Thread Chris Smith
+1 While it might work for teaching, it's not reasonable to ask software developers who want to write useful software to depend on haskell98 instead of base if they want more relevant types. I'd go one step further and say that we're not just talking about whether someone is an advanced user

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-27 Thread Daniel Gorín
Hi Iavor, On May 27, 2013, at 6:18 PM, Iavor Diatchki wrote: Hello, On Fri, May 24, 2013 at 12:42 AM, Daniel Gorín dgo...@dc.uba.ar wrote: On May 24, 2013, at 9:28 AM, Simon Peyton-Jones wrote: How about (in Haskell98) module Data.List ( foldr, ...) import qualified

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-27 Thread Chris Smith
I agree that it would be unfortunate to complicate the Prelude definitions of foldr and such by generalizing to type classes like Foldable. This proposal seems attractive to me as a way to reconcile abstraction when it's needed, and simplicity for beginners. However, it does seem like a common

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-27 Thread Andrew Farmer
I generally agree with Iavor's points, but if this is such an issue, why not make Prelude more general by default and have a special 'Prelude.Basic' with the more specific type signatures for beginners? The general Prelude would be implicitly imported as now, unless the module imported

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-27 Thread Edward A Kmett
This is basically what you get by default already with the raw proposal we've been talking about -- the Preludes in the haskell98 and haskell2010 remain unmodified by this proposal and are available for teaching use. Sent from my iPhone On May 27, 2013, at 8:53 PM, Andrew Farmer

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-25 Thread Daniel Gorín
Oh my! Now it's getting complicated. Hopefully not so! * I suppose that if Data.List re-exports foldr, it would go with the more specific type. Yes. * In your example, can I also use the more-polymorphic foldr, perhaps by saying Data.Foldable.foldr? Yes. More precisely, if you

RE: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-24 Thread Simon Peyton-Jones
How about (in Haskell98) module Data.List ( foldr, ...) import qualified Data.Foldable foldr :: (a - b - b) - b - [a] - b foldr = Data.Foldable.foldr Simon | -Original Message- | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell- |

Re: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-24 Thread Daniel Gorín
On May 24, 2013, at 9:28 AM, Simon Peyton-Jones wrote: How about (in Haskell98) module Data.List ( foldr, ...) import qualified Data.Foldable foldr :: (a - b - b) - b - [a] - b foldr = Data.Foldable.foldr It would not be the same! Using your example one will get

RE: A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-24 Thread Simon Peyton-Jones
Oh my! Now it's getting complicated. * I suppose that if Data.List re-exports foldr, it would go with the more specific type. * In your example, can I also use the more-polymorphic foldr, perhaps by saying Data.Foldable.foldr? * I wonder what would happen if Data.Foo specialised foldr in a

A language extension for dealing with Prelude.foldr vs Foldable.foldr and similar dilemmas

2013-05-23 Thread Daniel Gorín
Hi all, Given the ongoing discussion in the libraries mailing list on replacing (or removing) list functions in the Prelude in favor of the Foldable / Traversable generalizations, I was wondering if this wouldn't be better handled by a mild (IMO) extension to the module system. In a