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

Strange comment in NonEmpty #87

Closed
nobrakal opened this issue Jul 2, 2018 · 1 comment
Closed

Strange comment in NonEmpty #87

nobrakal opened this issue Jul 2, 2018 · 1 comment

Comments

@nobrakal
Copy link
Contributor

nobrakal commented Jul 2, 2018

Hi,

I just passed by:

-- TODO: Here if @context (==s) g == Just ctx@ then we know for sure that
-- @induce1 (/=s) g == Just subgraph@. Can we exploit this?
filterContext :: Eq a => a -> (a -> Bool) -> (a -> Bool) -> NonEmptyGraph a -> NonEmptyGraph a
filterContext s i o g = maybe g go $ G.context (==s) (T.toGraph g)

(Here: https://github.com/snowleopard/alga/blob/master/src/Algebra/Graph/NonEmpty.hs#L628 )

So I tried and tests failed (one could have guessed it) with removeEdge 0 0 $ edge 0 0 .

In fact:

>>> isJust $ context (==0) $ edge 0 0
True
>>> induce1 (/= 0 ) $ edge 0 0
Nothing

His this true for non loop edges ?

@snowleopard
Copy link
Owner

@nobrakal Hmm, I think you are right and the comment is wrong. Feel free to send a PR removing it, or I will do it myself. Thanks!

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

2 participants