haskell / fgl

A Functional Graph Library for Haskell
http://hackage.haskell.org/package/fgl
Other
185 stars 54 forks source link

Fix implementation of rc in TransClos. #87

Closed LambdaP closed 1 year ago

LambdaP commented 5 years ago

As observed in issue #86, the implementation of the function rc in the module Data.Graph.Inductive.Query.TransClos computes the graph with only the self-loops, rather than the reflexive closure of a graph.

This change conserves the existing edges, although it drops their labels in the process to satisfy the desired type of the function.

athas commented 2 years ago

This looks sensible, but could you add a test?

LambdaP commented 1 year ago

No. It has been three years since I worked to understand the code of this library. I don’t have time or motivation to go back to it now.

You’re welcome to use the code I contributed in any way you see fit. It would be a good idea, given how obviously wrong the original code is. But I’m not putting in more work for a one line commit that was ignored for that long (likely through no fault of your own).

andreasabel commented 1 year ago

@athas @LambdaP : You might be interested in:

Please make extra sure that this PR did not introduce any problems (like the exception reported there). You might be able to harvest a test case from there...