Re: [Haskell-cafe] The container problem

2008-09-29 Thread Albert Y. C. Lai
Andrew Coppin wrote: Seriously, that sounded like gibberish. Please don't say that. I think we are too polite to rudeness. While we shouldn't condemn people to RTFM, we shouldn't tolerate people calling us gibberish either. I mean unless we say something objectively gibberish.

Re: [Haskell-cafe] The container problem

2008-09-28 Thread David Menendez
On Sat, Sep 27, 2008 at 9:24 AM, Andrew Coppin [EMAIL PROTECTED] wrote: David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself. Data.Set is a functor from the category of Haskell

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 9:24, Andrew Coppin wrote: David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself.

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Brandon S. Allbery KF8NH
On 2008 Sep 27, at 12:41, Andrew Coppin wrote: I'm not sure how that qualifies set as not really a true monad anyway - but then, I don't know what a monad is, originally. I only know what it means in Haskell. I think you read him backwards: Map and Set are category-theory (true) monads,

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On 2008 Sep 27, at 12:41, Andrew Coppin wrote: I'm not sure how that qualifies set as not really a true monad anyway - but then, I don't know what a monad is, originally. I only know what it means in Haskell. I think you read him backwards: Map and Set are

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Andrew Coppin
Albert Y. C. Lai wrote: Andrew Coppin wrote: If I understand this correctly, to solve this problem you need either Functional Dependencies or Associated Types. Is that correct? A motivating example in papers on FD is exactly typeclasses for containers. Okasaki puts this into practice in the

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Antoine Latter
On Sat, Sep 27, 2008 at 12:23 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Can anybody actually demonstrate concretely how FDs and/or ATs would solve this problem? (I.e., enable you to write a class that any container can be a member of, despite constraints on the element types.) Sure! Using

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Matthieu Sozeau
Le 27 sept. 08 à 15:24, Andrew Coppin a écrit : David Menendez wrote: I wouldn't say that. It's important to remember that Haskell class Monad does not, and can not, represent *all* monads, only (strong) monads built on a functor from the category of Haskell types and functions to itself.

Re[2]: [Haskell-cafe] The container problem

2008-09-27 Thread Bulat Ziganshin
Hello Andrew, Saturday, September 27, 2008, 9:23:47 PM, you wrote: Can anybody actually demonstrate concretely how FDs and/or ATs would solve this problem? (I.e., enable you to write a class that any container can be a member of, despite constraints on the element types.) you may find

Re: [Haskell-cafe] The container problem

2008-09-27 Thread Ariel J. Birnbaum
I'm not actually bothered about every possible monad being representable as such in Haskell. I'd just like Set to work. ;-) What would work mean in this case? I see two different meanings: 1. Use monadic operations (mapM, guard) on Sets. How would you decide which operations are allowed and

[Haskell-cafe] The container problem

2008-09-26 Thread Andrew Coppin
Take a look around you. Haskell provides several sorts of container. We have: Data.List Data.Set Data.Map Data.Hashtable Data.ByteString Data.Sequence Data.Array Data.Tree Data.IntSet Data.IntMap ... In other words, we have *a lot* of different data containers. And yet, each one

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Albert Y. C. Lai
Andrew Coppin wrote: If I understand this correctly, to solve this problem you need either Functional Dependencies or Associated Types. Is that correct? A motivating example in papers on FD is exactly typeclasses for containers. Okasaki puts this into practice in the Edison library. Despite

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Derek Elkins
On Fri, 2008-09-26 at 19:15 +0100, Andrew Coppin wrote: Take a look around you. Haskell provides several sorts of container. We have: Data.List Data.Set Data.Map Data.Hashtable Data.ByteString Data.Sequence Data.Array Data.Tree Data.IntSet Data.IntMap ...

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Andrew Coppin
Derek Elkins wrote: One aspect of it is a bit of a You Aren't Going To Need It. Personally, I haven't had a huge problem with this in practice. What it basically means is that if you write a library function, *you* have to decide what containers you're going to use. It's not really

Re: [Haskell-cafe] The container problem

2008-09-26 Thread David Menendez
On Fri, Sep 26, 2008 at 5:37 PM, Andrew Coppin [EMAIL PROTECTED] wrote: As already noted, Data.Set *should* be a Monad, but can't be. The type system won't allow it. (And I know I'm not the first person to notice this...) I wouldn't say that. It's important to remember that Haskell class

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Jason Dusek
Can someone explain, why is it that Set can not be a Monad? -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Jonathan Cast
On Fri, 2008-09-26 at 15:25 -0700, Jason Dusek wrote: Can someone explain, why is it that Set can not be a Monad? It can't even be a functor (which all monads are). You can't implement fmap (+) $ Set.fromList [1, 2, 3] with Data.Set, because you can't order functions of type Integer -

Re[2]: [Haskell-cafe] The container problem

2008-09-26 Thread Bulat Ziganshin
Hello Andrew, Saturday, September 27, 2008, 1:37:12 AM, you wrote: answering your questions 1) there is 2 libs providing common Java-like interfaces to containers: Edison and Collections. almost noone uses it 2) having common type class for various things is most important when you write

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Dan Weston
More specifically, although a set is a perfectly good (lowercase) functor, Set is not a (Haskell) Functor. Set's map has an Ord constraint, but the Functor type constructor is parametric over *all* types, not just that proper subset of them that have a total ordering. But see attempts to

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Don Stewart
bulat.ziganshin: Hello Andrew, Saturday, September 27, 2008, 1:37:12 AM, you wrote: answering your questions 1) there is 2 libs providing common Java-like interfaces to containers: Edison and Collections. almost noone uses it 2) having common type class for various things is most

Re: [Haskell-cafe] The container problem

2008-09-26 Thread Derek Elkins
On Fri, 2008-09-26 at 22:37 +0100, Andrew Coppin wrote: Derek Elkins wrote: One aspect of it is a bit of a You Aren't Going To Need It. Personally, I haven't had a huge problem with this in practice. I suspected as much. Personally I'd recomend worrying about the problems you actually