tweag / funflow

Functional workflows
MIT License
362 stars 33 forks source link

Display a graph representation of a flow #179

Open GuillaumeDesforges opened 4 years ago

vreuter commented 3 years ago

Refer to https://github.com/tweag/funflow/blob/master/funflow/src/Control/Funflow/Base.hs#L104-L110 and https://github.com/tweag/funflow/blob/master/funflow/src/Control/Funflow/Diagram.hs

dorranh commented 3 years ago

@vreuter, I took a look at implementing this feature a while ago and my assessment was that it would require some updates to kernmantle to be able to implement. The key issue is whether a Rope can be traversed, and AFAIK this isn't really possible at the moment (I might be wrong though).

GuillaumeDesforges commented 3 years ago

I may be completly wrong, but you might be interested by this example: https://github.com/tweag/kernmantle/blob/19e018449f4fba68d383611a9d38a1b9e04e81ee/kernmantle/examples/ExLenses.hs

It defines a wander

EDIT: yeah, it's not this way around that you want it, so it's irrelevant, my bad sorry ^^"

dorranh commented 3 years ago

@GuillaumeDesforges, sorry for the late response! Ya, I had also hoped that would be what we are after, but I don't think it allows us to show the graph itself :slightly_frowning_face: . As far as I can tell, the interdependence of the individual tasks becomes somewhat opaque after being composed due to the current implementation of Arrow for Rope.

GuillaumeDesforges commented 3 years ago

Could we make an interpreter that gathers the Rope tasks data when we weave+run it?

dorranh commented 3 years ago

@GuillaumeDesforges I actually hadn't thought about that, but I do think that would work. The main downside there is that we further rely on the interpreter implementation which might damage extensibility in the long run. I really would like a better way to do this in kernmantle. It technically is already implementing a free Arrow and even does something similar to what we want with it's whole AutoIdent construct. I think the cleanest solution might be to update the Arrow instance for Rope in kernmantle itself to hold extra information on the task graph.