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

--toplevel-only #29

Open
kazu-yamamoto opened this issue Jun 22, 2023 · 9 comments
Open

--toplevel-only #29

kazu-yamamoto opened this issue Jun 22, 2023 · 9 comments

Comments

@kazu-yamamoto
Copy link

First of all, thank you for creating a great tool!

I would like to have call graphs of top level functions only where all non-exports are included but local-bindings under where are hidden.
Is such a feature technically possible?

@jonascarpay
Copy link
Owner

jonascarpay commented Jun 22, 2023

That's done by the --collapse family of options, in your case specifically --collapse-values. Or do I misunderstand what you're looking for?

Maybe they need better documentation/help text...

@kazu-yamamoto
Copy link
Author

I tried --collapse-values but it displays local functions under where in a top-level function.
It is vocal a bit for me.
I would like to have a call graph with top-level functions only.

@kazu-yamamoto
Copy link
Author

Currently, to get such a graph, I need to modify a module with its export list removed and use --exports-only.

@jonascarpay
Copy link
Owner

I tried --collapse-values but it displays local functions under where in a top-level function.
It is vocal a bit for me.
I would like to have a call graph with top-level functions only.

Oh, that's odd, I don't think this should happen! Is there any chance you can give me a MWE for this?

@kazu-yamamoto
Copy link
Author

What does "MWE" stand for?

@jonascarpay
Copy link
Owner

jonascarpay commented Jun 26, 2023

So, just to confirm, with --collapse-values you don't get this behavior (i.e. showing non-exported top-level bindings, but hiding where-clauses)?

module KazuTest () where

foo = bar
  where
    bar = foo

calligraphy KazuTest --collapse-values --stdout-mermaid:

flowchart TD
    node_0[foo]
    style node_0 stroke-dasharray: 5 5
    classDef default fill-opacity:0,stroke:#777;
Loading

What does "MWE" stand for?

Oh sorry, minimal working example. If indeed you're getting different behavior than the example above, a small example that reproduces the bug.

@kazu-yamamoto
Copy link
Author

In this case, I got the same result: foo only.

@jonascarpay
Copy link
Owner

Sorry, my question should have been clearer maybe. You say that with --collapse-values, "it displays local functions under where in a top-level function". Can you give an example of that? Because as I show here, that shouldn't be happening.

@kazu-yamamoto
Copy link
Author

The example which I hit upon is huge.
So, I'm trying to create a small example now.

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