snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
153 stars 63 forks source link

Law given for `GrowingAppend` is wrong. #91

Closed bennofs closed 8 years ago

bennofs commented 8 years ago

Or there are wrong instances. Consider the following:

λ: let s1 = fromList [1]
λ: olength (s1 <> s1)
1

But the law for GrowingAppend says: -- | olength (x <> y) >= olength x + olength y

snoyberg commented 8 years ago

That equality is backwards, the law was written incorrectly. Could you send a PR to fix? Yes, it's just a one character change

On Tue, Feb 23, 2016, 4:27 PM Benno Fünfstück notifications@github.com wrote:

Or there are wrong instances. Consider the following:

λ: let s1 = fromList [1] λ: olength (s1 <> s1) 1

But the law for GrowingAppend says: -- | olength (x <> y) >= olength x + olength y

— Reply to this email directly or view it on GitHub https://github.com/snoyberg/mono-traversable/issues/91.

treeowl commented 8 years ago

Ha. I just came here to report the same thing. I'm still quite unclear on why this class, which does nothing but impose a law, is a superclass of other classes. Is that law really so useful?