Mostrando la salida de `cabal-plan` visualmente

Cuando corremos cabal plan diff hay mucho ruido en la salida. Este script de python muestra la salida mucho más accesible: #!/usr/bin/env python3 """Summarize the `Package versions` section of `cabal-plan diff` output. Pipe `cabal-plan diff` (or similar) output to this script. It extracts the section between the `Package versions` and `Dependency graph` headers, then prints: pkg-name oldver -> newver # for packages that changed new pkg-name ver # for packages only on the + side deleted pkg-name ver # for packages only on the - side """ import re import sys LINE_RE = re.compile(r"^\s*([-+])(\S+?)-(\d[\w.]*)\s") def parse(stream): in_section = False removed: dict[str, str] = {} added: dict[str, str] = {} for line in stream: stripped = line.strip() if stripped.startswith("Package versions"): in_section = True continue if stripped.startswith("Dependency graph"): break if not in_section: continue m = LINE_RE.match(line) if not m: continue sign, name, version = m.group(1), m.group(2), m.group(3) (removed if sign == "-" else added)[name] = version return removed, added def main() -> int: removed, added = parse(sys.stdin) changed_names = sorted(set(removed) & set(added)) only_removed = sorted(set(removed) - set(added)) only_added = sorted(set(added) - set(removed)) name_w = max( (len(n) for n in changed_names + only_added + only_removed), default=0, ) old_w = max((len(removed[n]) for n in changed_names), default=0) for name in changed_names: print(f"{name:<{name_w}} {removed[name]:<{old_w}} -> {added[name]}") if only_added: print() for name in only_added: print(f"new {name:<{name_w}} {added[name]}") if only_removed: print() for name in only_removed: print(f"deleted {name:<{name_w}} {removed[name]}") return 0 if __name__ == "__main__": sys.exit(main()) Se usa pasando la entrada en una tubería: ...

19 May 2026 · 2 min · 417 words · Javier Sagredo

Classgraph

Git A GHC typechecker plugin and browser visualizer for Haskell typeclass hierarchies. Drop the plugin onto a project, render the captured data as a self-contained interactive HTML page, and explore the inheritance DAG, class instances, type families, and superclass requirements with xdot-style highlighting. target package ───────────► per-module JSON dumps (built with the plugin) (.classgraph/*.json) │ ▼ classgraph-view ──────► classgraph.html (one self-contained file) What you get When you point the plugin at a target package and run the viewer, you get: ...

15 January 2026 · 14 min · 2893 words · Javier Sagredo