Code Monkey home page Code Monkey logo

Comments (4)

justinmanley avatar justinmanley commented on September 14, 2024

Big thanks to nick8325 for helping me understand this behavior in nick8325/quickcheck#53!

from fgl.

justinmanley avatar justinmanley commented on September 14, 2024

By the way - I'm using fgl 5.5.1.0.

from fgl.

ivan-m avatar ivan-m commented on September 14, 2024

Hmmmm.... this is a bug in that:

let g = Graph.mkGraph [(1,())] [(1,2,True), (2,1,False)] :: Gr () Bool

Should return an error: you're referencing nodes that don't exist in the graph!

(And that's what I get when I try this:

mkGraph *** Exception: Data/Graph/Inductive/Graph.hs:229:5-38: Irrefutable pattern failed for pattern (Data.Maybe.Just (pr,
                                                         _,
                                                         la,
                                                         su),
                                        g')

but that might be from changes I've made since the release.)

This occurs, as there is no validation that occurs in mkGraph; there are two possible ways of handling this:

  • Add validation to mkGraph; this will make it slower and less efficient for the (more common I think) cases of correct usage
  • Keep doing what it does (in HEAD) of throwing an error

Unless there's a compelling reason, I don't think I'll change the behaviour.

To be able to use QuickCheck with FGL, see #12.

from fgl.

justinmanley avatar justinmanley commented on September 14, 2024

Ah, I see. Good to know that the behavior has been fixed in master. Thanks!

from fgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.