Recommendations for implementing static analysis of the entire program for Haskell

As part of a research project on property-based testing, I need to do a static analysis of the entire Haskell program. I am looking for suggestions on how to implement a comprehensive analysis of Haskell programs, hopefully without creating a lot of infrastructure.

I looked at the Haskell template, which has many features that I need, but lacks a key function: in Template Haskell, implemented in the GHC, there seems to be no way to get the function definition by name . (Related SO question: How do I get a function declaration using `reify`? )

I suspect there might be some way to run entire Haskell programs using the GHC API, but I cannot easily determine how this can be done from the GHC API documentation.

In particular, given the site of the function call, I need to find the corresponding function definition. I am particularly interested in solutions based on Haskell or GHC templates.

Is there a way to do all the analysis of Haskell program programs without creating the entire infrastructure?

+4
source share

Source: https://habr.com/ru/post/1541051/


All Articles