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