Re: [Haskell-cafe] Restricted type classes

2010-09-10 Thread wren ng thornton
On 9/10/10 12:47 AM, David Menendez wrote: It seems like you could use a similar argument to show that fmap id /= id. Specifically, xs and map id xs are equivalent lists, but they occupy different locations in memory. By replacing xs with map id xs, you can come arbitrarily close to doubling a

Re: [Haskell-cafe] Restricted type classes

2010-09-10 Thread Dan Doel
On Wednesday 08 September 2010 11:17:43 pm wren ng thornton wrote: -- | Proof that impure is not p...@e fmap f (impure a) == fmap f (E a a) == E (f a) a /= E (f a) (f a) == impure (f a) I don't believe your proof. The type of E is as follows: E :: a - b - E

Re: [Haskell-cafe] Restricted type classes

2010-09-09 Thread wren ng thornton
On 9/9/10 1:04 AM, David Menendez wrote: Fascinating. I figured there might be a counter-example involving seq, but this is pretty subtle. In particular, would it be fair to say that in Haskell-without-seq, E (f a) a and E (f a) (f a) are indistinguishable? Yes, I think that without

Re: [Haskell-cafe] Restricted type classes

2010-09-09 Thread David Menendez
On Thu, Sep 9, 2010 at 11:33 PM, wren ng thornton w...@freegeek.org wrote: On 9/9/10 1:04 AM, David Menendez wrote: Fascinating. I figured there might be a counter-example involving seq, but this is pretty subtle. In particular, would it be fair to say that in Haskell-without-seq, E (f a) a

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 12:33 AM, Ivan Lazar Miljenovic wrote: On 7 September 2010 14:24, wren ng thorntonw...@freegeek.org wrote: On 9/7/10 12:04 AM, Ivan Lazar Miljenovic wrote: Not quite sure what you mean by a mis-match Just that they're not the same thing. For example, ZipList supports pure but it

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 7:26 AM, Neil Brown wrote: On 07/09/10 05:24, wren ng thornton wrote: Just that they're not the same thing. For example, ZipList supports pure but it has no meaningful instance of singleton since every ZipList is infinite. I don't believe that every ZipList is infinite (if this

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread Ivan Lazar Miljenovic
On 9 September 2010 12:10, wren ng thornton w...@freegeek.org wrote: I think the shape of the classes for singletons, insert, coinsert, and union still needs some work. For instance, the definitions I've given earlier were assuming a (multi)set-like or sequence-like container, but we can also

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 4:21 AM, Daniel Fischer wrote: On Tuesday 07 September 2010 05:22:55, David Menendez wrote: In fact, I think *every* appropriately-typed function satisfies that law. Does anyone know of a counter-example? -- | Multiply the *Hask* category by its number of objects. data E a

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread David Menendez
On Wed, Sep 8, 2010 at 11:17 PM, wren ng thornton w...@freegeek.org wrote: On 9/7/10 4:21 AM, Daniel Fischer wrote: On Tuesday 07 September 2010 05:22:55, David Menendez wrote: In fact, I think *every* appropriately-typed function satisfies that law. Does anyone know of a counter-example?  

Re: [Haskell-cafe] Restricted type classes

2010-09-07 Thread Daniel Fischer
On Tuesday 07 September 2010 05:22:55, David Menendez wrote: On Mon, Sep 6, 2010 at 10:22 PM, wren ng thornton w...@freegeek.org wrote: On 9/6/10 1:33 PM, David Menendez wrote: For that matter, can you even describe what pure is intended to do without reference to*  or join? As already

Re: [Haskell-cafe] Restricted type classes

2010-09-07 Thread John Lato
2010/9/7 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com 2010/9/7 Gábor Lehel illiss...@gmail.com: *That said*, I actually have nothing at all against splitting the 'a - f a' method out into a separate class if you think it's useful, whether you call it Pointed or something else. (And

Re: [Haskell-cafe] Restricted type classes

2010-09-07 Thread John Lato
From: Stephen Tetley stephen.tet...@gmail.com On 6 September 2010 20:18, John Lato jwl...@gmail.com wrote: Can you give an example of a Functor that doesn't have pure? I think it's Pointed Functors which are useful; not Functor by itself. Strictly speaking is Pair one? The current

Re: [Haskell-cafe] Restricted type classes

2010-09-07 Thread Neil Brown
On 07/09/10 05:24, wren ng thornton wrote: that other class would (most likely) be a subclass of pointed functors. In any case, it does mean there's something of a mismatch between singleton vs return/pure/point/unit. Not quite sure what you mean by a mis-match Of course, I'd expect

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/5/10 10:19 AM, Ivan Lazar Miljenovic wrote: Hmmm is there any reason for Functor to be a superclass of Pointed? I understand Functor and Pointed being superclasses of Applicative (which in turn is a superclass of Monad), but can't see any relation between Pointed and Functor...

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Ivan Lazar Miljenovic
On 6 September 2010 16:15, wren ng thornton w...@freegeek.org wrote: On 9/5/10 10:19 AM, Ivan Lazar Miljenovic wrote: Hmmm is there any reason for Functor to be a superclass of Pointed?  I understand Functor and Pointed being superclasses of Applicative (which in turn is a superclass of

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread John Lato
On Sun, Sep 5, 2010 at 7:18 PM, David Menendez d...@zednenem.com wrote: On Sun, Sep 5, 2010 at 8:40 AM, John Lato jwl...@gmail.com wrote: On Sat, Sep 4, 2010 at 12:34 PM, David Menendez d...@zednenem.com wrote: On Fri, Sep 3, 2010 at 8:23 AM, John Lato jwl...@gmail.com wrote: +1

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread John Lato
Message: 20 Date: Sat, 04 Sep 2010 03:40:49 -0400 From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] Restricted type classes To: Haskell Cafe haskell-cafe@haskell.org Message-ID: 4c81f801@freegeek.org Content-Type: text/plain; charset=UTF-8; format=flowed On 9/3/10

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Gábor Lehel
On Mon, Sep 6, 2010 at 5:11 PM, John Lato jwl...@gmail.com wrote: Message: 20 Date: Sat, 04 Sep 2010 03:40:49 -0400 From: wren ng thornton w...@freegeek.org Subject: Re: [Haskell-cafe] Restricted type classes To: Haskell Cafe haskell-cafe@haskell.org Message-ID: 4c81f801@freegeek.org

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread David Menendez
On Mon, Sep 6, 2010 at 7:51 AM, John Lato jwl...@gmail.com wrote: On Sun, Sep 5, 2010 at 7:18 PM, David Menendez d...@zednenem.com wrote: On Sun, Sep 5, 2010 at 8:40 AM, John Lato jwl...@gmail.com wrote: On Sat, Sep 4, 2010 at 12:34 PM, David Menendez d...@zednenem.com wrote: On

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread John Lato
On Mon, Sep 6, 2010 at 12:33 PM, David Menendez d...@zednenem.com wrote: On Mon, Sep 6, 2010 at 7:51 AM, John Lato jwl...@gmail.com wrote: On Sun, Sep 5, 2010 at 7:18 PM, David Menendez d...@zednenem.com wrote: On Sun, Sep 5, 2010 at 8:40 AM, John Lato jwl...@gmail.com wrote: On

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Stephen Tetley
On 6 September 2010 20:18, John Lato jwl...@gmail.com wrote: Can you give an example of a Functor that doesn't have pure?  I think it's Pointed Functors which are useful; not Functor by itself. Strictly speaking is Pair one? The current implementation tacks on monoid. Best wishes Stephen

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/6/10 2:35 AM, Ivan Lazar Miljenovic wrote: Well, if we consider what this does, pure is equivalent to singleton for container types. The actual definition of pure (or any other aspect of Pointed) doesn't require Functor; however there are properties for types that are instances of Functor

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/6/10 1:33 PM, David Menendez wrote: For that matter, can you even describe what pure is intended to do without reference to* or join? As already stated: fmap f . pure = pure . f -- Live well, ~wren ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread David Menendez
On Mon, Sep 6, 2010 at 10:22 PM, wren ng thornton w...@freegeek.org wrote: On 9/6/10 1:33 PM, David Menendez wrote: For that matter, can you even describe what pure is intended to do without reference to*  or join? As already stated: fmap f . pure = pure . f That's pretty general. For

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Ivan Lazar Miljenovic
2010/9/7 Gábor Lehel illiss...@gmail.com: *That said*, I actually have nothing at all against splitting the 'a - f a' method out into a separate class if you think it's useful, whether you call it Pointed or something else. (And `class (Pointed f, Functor f) = PointedFunctor f` is sort of

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Ivan Lazar Miljenovic
On 7 September 2010 12:18, wren ng thornton w...@freegeek.org wrote: On 9/6/10 2:35 AM, Ivan Lazar Miljenovic wrote: Well, if we consider what this does, pure is equivalent to singleton for container types.  The actual definition of pure (or any other aspect of Pointed) doesn't require

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/7/10 12:04 AM, Ivan Lazar Miljenovic wrote: Perhaps this just means that union/insert should be part of some other class. That is part of the plan (I'm tentatively calling the class with the insert method Buildable or Extendable); this means that if a type is an instance of Monoid (for

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread Ivan Lazar Miljenovic
On 7 September 2010 14:24, wren ng thornton w...@freegeek.org wrote: On 9/7/10 12:04 AM, Ivan Lazar Miljenovic wrote: Perhaps this just means that union/insert should be part of some other class. That is part of the plan (I'm tentatively calling the class with the insert method Buildable or

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread John Lato
On Fri, Sep 3, 2010 at 12:01 PM, C. McCann c...@uptoisomorphism.net wrote: On Fri, Sep 3, 2010 at 11:47 AM, John Lato jwl...@gmail.com wrote: On Fri, Sep 3, 2010 at 1:29 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 3 September 2010 22:23, John Lato jwl...@gmail.com wrote:

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread John Lato
On Sat, Sep 4, 2010 at 12:34 PM, David Menendez d...@zednenem.com wrote: On Fri, Sep 3, 2010 at 8:23 AM, John Lato jwl...@gmail.com wrote: +1 for using the proper constraints, and especially for bringing over Pointed (and anything else that applies). What's the argument for Pointed? Are

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread Ivan Lazar Miljenovic
On 5 September 2010 22:40, John Lato jwl...@gmail.com wrote: Having Pointed is categorically the right thing to do, which is why I argue for its inclusion.  Also, I think it would be prudent to avoid a situation with the possibility of turning into a rehash of the Functor/Applicative/Monad

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread John Lato
On Sun, Sep 5, 2010 at 7:47 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 5 September 2010 22:40, John Lato jwl...@gmail.com wrote: Having Pointed is categorically the right thing to do, which is why I argue for its inclusion. Also, I think it would be prudent to avoid a

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread Sebastian Fischer
Just because we don't have a use now doesn't mean it might not be useful in the future. I am suspicious about complicating a design for potential future benefits. However, difference lists provide an example of a type that support Pointed more naturally than Applicative: the dlist package

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread Ivan Lazar Miljenovic
On 6 September 2010 00:11, Sebastian Fischer s...@informatik.uni-kiel.de wrote: Just because we don't have a use now doesn't mean it might not be useful in the future. I am suspicious about complicating a design for potential future benefits. However, difference lists provide an example of a

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread David Menendez
On Sun, Sep 5, 2010 at 8:40 AM, John Lato jwl...@gmail.com wrote: On Sat, Sep 4, 2010 at 12:34 PM, David Menendez d...@zednenem.com wrote: On Fri, Sep 3, 2010 at 8:23 AM, John Lato jwl...@gmail.com wrote: +1 for using the proper constraints, and especially for bringing over Pointed (and

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread David Menendez
On Sun, Sep 5, 2010 at 8:47 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: I _can_ think of a data type that could conceivably be an instance of Pointed but not Applicative: a BloomFilter (though there's not really any point in having a BloomFilter with only one value that I can

Re: [Haskell-cafe] Restricted type classes

2010-09-05 Thread Ivan Lazar Miljenovic
On 6 September 2010 04:25, David Menendez d...@zednenem.com wrote: On Sun, Sep 5, 2010 at 8:47 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: I _can_ think of a data type that could conceivably be an instance of Pointed but not Applicative: a BloomFilter (though there's not really

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread wren ng thornton
On 9/3/10 12:16 AM, Ivan Lazar Miljenovic wrote: 1) How should I name the kind * versions? For example, the kind * version of Functor is currently called Mappable with a class method of rigidMap. What should I call the kind * version of Foldable and its corresponding methods? Is there a valid

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ivan Lazar Miljenovic
On 4 September 2010 17:40, wren ng thornton w...@freegeek.org wrote: On 9/3/10 12:16 AM, Ivan Lazar Miljenovic wrote: 1) How should I name the kind * versions?  For example, the kind * version of Functor is currently called Mappable with a class method of rigidMap.  What should I call the

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread wren ng thornton
On 9/4/10 3:50 AM, Ivan Lazar Miljenovic wrote: On 4 September 2010 17:40, wren ng thorntonw...@freegeek.org wrote: So, in the interest of generality, perhaps you should just pick a letter or a short prefix and use that for each of the classes. In my blog posts I called them 0-monads,

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ivan Lazar Miljenovic
On 4 September 2010 18:27, wren ng thornton w...@freegeek.org wrote: On 9/4/10 3:50 AM, Ivan Lazar Miljenovic wrote: On 4 September 2010 17:40, wren ng thorntonw...@freegeek.org  wrote: So, in the interest of generality, perhaps you should just pick a letter or a short prefix and use that

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Stephen Tetley
On 4 September 2010 08:50, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: 3) Am I wasting my time with this? Not at all. Many people want a good containers API, and many people want a cleaned up version of the categorical classes which isn't quite as involved as category-extras. Go

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ivan Lazar Miljenovic
On 4 September 2010 18:54, Stephen Tetley stephen.tet...@gmail.com wrote: Supposing classes is the way to go, I think there's still a lot of design work to be done on what the classes should be rather than how they are implemented. The current design space (ListLike and your Data.Containers)

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Stephen Tetley
On 4 September 2010 09:57, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Where exactly can I find these observations on the analogies between data structures and numerical representations? Chris Okasaki - Chapter 9 of Purely Functional Data Structures. Ralf Hinze's slides Number

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ben Millwood
I have only one thing to add to this discussion: On Fri, Sep 3, 2010 at 5:16 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: 2b) Is it OK to promote functions that use a class to being class methods?  When I was discussing this in #haskell several people mentioned that defining

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread David Menendez
On Fri, Sep 3, 2010 at 8:23 AM, John Lato jwl...@gmail.com wrote: Do you have a kind * implementation of Foldable?  I'd be interested in seeing it, because I was unable to create a usable implementation (based upon the RMonad scheme) on my last attempt. I always figured it would look something

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ivan Lazar Miljenovic
On 5 September 2010 03:34, David Menendez d...@zednenem.com wrote: On Fri, Sep 3, 2010 at 8:23 AM, John Lato jwl...@gmail.com wrote: Do you have a kind * implementation of Foldable?  I'd be interested in seeing it, because I was unable to create a usable implementation (based upon the RMonad

Re: [Haskell-cafe] Restricted type classes

2010-09-03 Thread John Lato
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com When I released the first version of container-classes (which I hacked on during AusHac), some people said I should split out the various folding, etc. into duplicates of the current Foldable class, etc. rather than having large

Re: [Haskell-cafe] Restricted type classes

2010-09-03 Thread Tobias Brandt
On 3 September 2010 06:16, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: 2c) Should I keep the classes as-is, or should I explicitly put in the constraints mentioned in the Typeclassopedia (e.g. make Applicative an explicit superclass of Monad, and define return = pure for

Re: [Haskell-cafe] Restricted type classes

2010-09-03 Thread C. McCann
On Fri, Sep 3, 2010 at 11:47 AM, John Lato jwl...@gmail.com wrote: On Fri, Sep 3, 2010 at 1:29 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 3 September 2010 22:23, John Lato jwl...@gmail.com wrote: Do you have a kind * implementation of Foldable?  I'd be interested in

[Haskell-cafe] Restricted type classes

2010-09-02 Thread Ivan Lazar Miljenovic
When I released the first version of container-classes (which I hacked on during AusHac), some people said I should split out the various folding, etc. into duplicates of the current Foldable class, etc. rather than having large monolithic classes. I've been working on this (see my more recent