{"id":29820976,"url":"https://github.com/eswar2001/fieldinspector","last_synced_at":"2025-07-28T23:38:33.025Z","repository":{"id":245392525,"uuid":"817599157","full_name":"eswar2001/fieldInspector","owner":"eswar2001","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-26T07:02:40.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-26T11:05:28.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eswar2001.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-20T04:23:13.000Z","updated_at":"2024-06-26T07:02:44.000Z","dependencies_parsed_at":"2024-06-25T10:56:15.669Z","dependency_job_id":null,"html_url":"https://github.com/eswar2001/fieldInspector","commit_stats":null,"previous_names":["eswar2001/fieldinspector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eswar2001/fieldInspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eswar2001%2FfieldInspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eswar2001%2FfieldInspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eswar2001%2FfieldInspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eswar2001%2FfieldInspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eswar2001","download_url":"https://codeload.github.com/eswar2001/fieldInspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eswar2001%2FfieldInspector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267604734,"owners_count":24114548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-28T23:38:31.781Z","updated_at":"2025-07-28T23:38:33.018Z","avatar_url":"https://github.com/eswar2001.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FieldInspector Plugin\n\n## Overview\n\nThe FieldInspector plugin is a GHC (Glasgow Haskell Compiler) plugin designed to collect and analyze field usage information within Haskell code. This plugin is useful for understanding how fields within data types are used across different modules in a Haskell project.\n\n## Installation\n\nTo use the FieldInspector plugin, include it in your GHC configuration. Typically, this involves adding the plugin to your project's `.cabal` file or passing it as a command-line argument when invoking GHC.\n\n## Usage\n\n### Command-Line Options\n\nThe plugin accepts the following command-line options:\n\n- A single optional argument specifying the output directory for the generated JSON files. If no argument is provided, the default directory is `/tmp/fieldInspector/`.\n\n### Enabling the Plugin\n\nTo enable the plugin, add the following line to your GHC command:\n\n```\n-ghc-options \"-fplugin=FieldInspector.Plugin\"\n```\nIf you want to specify an output directory, use:\n```\n-ghc-options \"-fplugin=FieldInspector.Plugin:\u003coutput-directory\u003e\"\n```\n\n## How It Works\n\nThe plugin operates in two main phases:\n\n1. **Core-to-Core Pass**:\n   - The `buildCfgPass` function is executed during the core-to-core transformation phase of the GHC compilation process.\n   - This function analyzes the Core bindings (`CoreBind`) in the current module and collects field usage information.\n   - The collected information is written to a JSON file named `fieldUsage.json` in the specified or default directory.\n\n2. **Type Collection**:\n   - The `collectTypes` function is executed after the type-checking phase.\n   - This function collects information about type constructors (`TyCon`) and data constructors (`DataCon`) in the module.\n   - The collected type information is written to a JSON file named `types.json` in the specified or default directory.\n\n## Output\nThe plugin generates two JSON files for each module:\n\n### fieldUsage.json: \n    Contains information about field usage within the module.\n### types.json: \n    Contains information about types and their constructors within the module.\n\n\n## The exe onsolidates these files into two comprehensive datasets:\n\n### fieldUsage-data.json:\n    consolidated all modules data\n### types-data.json\n    consolidated all modules data","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feswar2001%2Ffieldinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feswar2001%2Ffieldinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feswar2001%2Ffieldinspector/lists"}