4

I'm trying to dump type information of all identifiers in an Haskell project, basically it's the same as traversing the typed abstract syntax tree.

From another question, OCaml exposes its internal APIs through a library called compiler-libs. I'm wondering how is Haskell's support for similar task?

1
  • Unfortunately GHC does not expose a nice API for this. You might get some milage from haskell-type-exts. Commented Feb 8, 2015 at 7:02

1 Answer 1

1

GHC-as-a-library gives you a TypecheckedModule, and getNamesInScope, which includes the type of each name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.