haskell

package
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package haskell implements a gorisk analyzer for Haskell projects. It supports cabal.project.freeze, stack.yaml.lock, and *.cabal files.

Package haskell implements a gorisk analyzer for Haskell projects. It supports cabal.project.freeze, stack.yaml.lock, and *.cabal files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIRGraph

func BuildIRGraph(g *graph.DependencyGraph) ir.IRGraph

BuildIRGraph builds a function-level IR graph for a Haskell dependency graph.

func Detect

func Detect(dir string) capability.CapabilitySet

Detect walks .hs and .lhs files in dir and returns the combined capability set.

func DetectFunctions

func DetectFunctions(dir, pkgName string, files []string) (map[string]ir.FunctionCaps, []ir.CallEdge, error)

DetectFunctions parses Haskell source files and returns per-function capability sets and call edges.

Types

type Adapter

type Adapter struct{}

Adapter implements the analyzer.Adapter interface for Haskell projects.

func (Adapter) Load

func (Adapter) Load(dir string) (*graph.DependencyGraph, error)

Load parses the Haskell dependency lockfile in dir, detects capabilities from .hs and .lhs source files, and returns a *graph.DependencyGraph.

func (Adapter) Name

func (Adapter) Name() string

Name returns the language identifier for this adapter.

type HaskellFunction

type HaskellFunction struct {
	Name      string
	StartLine int
	EndLine   int
	Body      string
}

HaskellFunction represents a top-level Haskell function definition.

type HaskellPackage

type HaskellPackage struct {
	Name         string
	Version      string
	Direct       bool
	Dependencies []string
}

HaskellPackage represents a Haskell dependency extracted from a lockfile.

func Load

func Load(dir string) (pkgs []HaskellPackage, retErr error)

Load detects and parses the Haskell dependency lockfile in dir. Priority: cabal.project.freeze → stack.yaml.lock → *.cabal (glob top-level) Load never panics; it returns a structured error on failure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL