Skip to content

Add Haskell parser support (.hs) #141

@josephismikhail

Description

@josephismikhail

Problem

Ix does not currently parse .hs files. Haskell source files are treated as unrecognized and excluded from analysis, meaning functional logic, type definitions, and module structure written in Haskell are invisible to the system.

Proposed solution

Add a Haskell parser that can identify and extract:

  • Module declarations (e.g. module MyApp.Utils where)
  • Import statements (qualified and unqualified)
  • Function definitions and type signatures
  • Type, newtype, and data declarations
  • Typeclass definitions and instances (e.g. class, instance)
  • Where and let bindings
  • Deriving clauses (e.g. deriving (Show, Eq))

Support the following file patterns: *.hs

Why it matters

Haskell is used in domains where correctness and strong typing are critical — compilers, financial systems, and formal verification tooling. Its type system and module structure carry significant semantic meaning about how a codebase is organized. Without parsing Haskell, Ix cannot reason about type hierarchies, module dependencies, or the functional architecture of codebases built with it.

Merge requirements

Before this can be merged to main, the following must pass:

  • Tested on 3 repos
  • No regressions on existing parsers (ix map on a known TS/JS repo, verify counts unchanged)
  • Unit + smoke tests pass (npm test in ix-cli)
  • Module declarations ingested as entities
  • Top-level functions and type signatures resolved as entities
  • data, newtype, and type declarations ingested
  • Type class definitions (class) and instances (instance) ingested
  • CONTAINS chains correctly: module → function/type/class
  • ix text returns results with language: haskell
  • ix contains returns members for a known Haskell module

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions