Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-24 Thread George Giorgidze
Hi Alexander, Thanks for commenting on this issue. On 21 June 2012 16:34, Alexander Solla alex.so...@gmail.com wrote: These nits don't need to be picked.  The theory of equivalence relations is extremely well understood.  This is a topic covered by the sophomore mathematics level. I did not

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-21 Thread George Giorgidze
Hi Derek, Thanks for providing the executable example that demonstrates your point. It is an interesting one. See my response below. I think it takes us into the discussion as to what constitutes reasonable/law abiding instances of Eq and Ord and what client code that uses Eq and Ord instances

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-21 Thread George Giorgidze
Hi Dan, On 21 June 2012 04:21, Dan Burton danburton.em...@gmail.com wrote: Hi George, I didn't have access to my computer over the weekend, so I apologize for not actually running the examples I provided. I was simply projecting what I thought could reasonably be assumed about the behavior

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-21 Thread Alexander Solla
On Thu, Jun 21, 2012 at 7:00 AM, George Giorgidze giorgi...@gmail.comwrote: Regarding antisymmetry, if I also define instance Ord Foo where (==) = (==) `on` a then would that count as satisfying the law? Probably, you mean here Eq instead of Ord. If a = b and b = a then a = b

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-21 Thread Derek Elkins
On Thu, Jun 21, 2012 at 8:30 AM, George Giorgidze giorgi...@gmail.com wrote: Hi Derek, Thanks for providing the executable example that demonstrates your point. It is an interesting one. See my response below. I think it takes us into the discussion as to what constitutes reasonable/law

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-20 Thread Dan Burton
Hi George, I didn't have access to my computer over the weekend, so I apologize for not actually running the examples I provided. I was simply projecting what I thought could reasonably be assumed about the behavior of a Set. Data.Set.Monad's departure from those assumptions is a double-edged

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-19 Thread George Giorgidze
Hi Derek, Thanks for clarifying your point. You are right that (fromList . toList) = id is a desirable and it holds for Data.Set. But your suggestions that this property does not hold for Data.Set.Monad is not correct. Please check out the repo, I have just pushed a quickcheck definition for

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-19 Thread Derek Elkins
Un-top-posted. See below. On 19 June 2012 02:21, Derek Elkins derek.a.elk...@gmail.com wrote: On Jun 18, 2012 4:54 PM, George Giorgidze giorgi...@gmail.com wrote: Hi Derek, On 16 June 2012 21:53, Derek Elkins derek.a.elk...@gmail.com wrote: The law that ends up failing is toList .

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-18 Thread George Giorgidze
Hi Dan, Thanks for your feedback and your question regarding the functor laws. Please try your example in GHCi and/or evaluate it by hand. The library does not violate the functor laws. I committed quick check properties for functor laws, as well as, laws for other type classes to the repo. You

Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

2012-06-18 Thread George Giorgidze
Hi Derek, On 16 June 2012 21:53, Derek Elkins derek.a.elk...@gmail.com wrote: The law that ends up failing is toList . fromList /= id, i.e. fmap g . toList . fromList . fmap h /= fmap g . fmap h This is not related to functor laws. The property that you desire is about toList and fromList.

Re: [Haskell] ANNOUNCE: set-monad

2012-06-16 Thread Dan Burton
Convenience aside, doesn't the functor instance conceptually violate some sort of law? fmap (const 1) someSet The entire shape of the set changes. fmap (g . h) = fmap g . fmap h This law wouldn't hold given the following contrived ord instance data Foo = Foo { a, b :: Int } instance Ord Foo

Re: [Haskell] ANNOUNCE: set-monad

2012-06-16 Thread Derek Elkins
On Sat, Jun 16, 2012 at 3:47 AM, Dan Burton danburton.em...@gmail.com wrote: Convenience aside, doesn't the functor instance conceptually violate some sort of law? fmap (const 1) someSet The entire shape of the set changes. fmap (g . h) = fmap g . fmap h This law wouldn't hold given

[Haskell] ANNOUNCE: set-monad

2012-06-15 Thread George Giorgidze
I would like to announce the first release of the set-monad library. On Hackage: http://hackage.haskell.org/package/set-monad The set-monad library exports the Set abstract data type and set-manipulating functions. These functions behave exactly as their namesakes from the Data.Set module of the