Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid exposing internals in DList #133

Closed
mausch opened this issue Nov 7, 2012 · 3 comments
Closed

Avoid exposing internals in DList #133

mausch opened this issue Nov 7, 2012 · 3 comments

Comments

@mausch
Copy link
Member

mausch commented Nov 7, 2012

When adding a monoid instance for DList:

[<GeneralizableValue>]
let monoid<'a> = 
    { new Monoid<'a DList>() with
        override x.Zero() = empty
        override x.Combine(a,b) = append a b }

It violates the monoid laws:

[<Test>]
let ``dlist monoid``() =
    checkMonoid "dlist" DList.monoid<int>
@mausch
Copy link
Member Author

mausch commented Nov 25, 2012

The reason this fails is that with the current implementation it's possible to build invalid instances of DLists, e.g. Join(Nil,Nil,5), and FsCheck does exactly that. The solution is to redesign DList to avoid this.

@ghost
Copy link

ghost commented Jun 24, 2013

Can this be closed? Is it a significant issue?

@ghost
Copy link

ghost commented Jun 24, 2013

Combined this with #164

@ghost ghost closed this as completed Jun 24, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant