Skip to main content

hx_toolchain/
lib.rs

1//! Toolchain detection and management for hx.
2//!
3//! This crate handles:
4//! - Detecting GHC, Cabal, GHCup, HLS, and BHC
5//! - Parsing tool versions
6//! - Installing toolchains via ghcup or direct download
7//! - Checking toolchain requirements and auto-installing
8//! - Direct GHC and Cabal binary downloads (no ghcup dependency required)
9//! - Per-project toolchain version management
10//! - BHC (Basel Haskell Compiler) detection and management
11//! - Release metadata (versions, tags, bindist URLs, checksums) from ghcup's
12//!   published metadata, with built-in tables as the offline fallback
13
14pub mod bhc;
15pub mod cabal;
16pub mod check;
17pub mod detect;
18pub mod ghc;
19pub mod install;
20pub mod metadata;
21pub mod verify;
22
23pub use bhc::{
24    BhcError, BhcInstallOptions, BhcInstallResult, BhcVersion, InstalledBhc, KNOWN_BHC_VERSIONS,
25    RECOMMENDED_BHC_VERSION, bhc_download_url, bhc_install_dir,
26    current_platform as bhc_current_platform, detect as detect_bhc, install_bhc,
27    is_known_version as is_known_bhc_version, is_valid_version as is_valid_bhc_version,
28    known_versions as known_bhc_versions, list_installed as list_installed_bhc, remove_bhc,
29    set_active as set_active_bhc, version_install_path as bhc_version_install_path,
30};
31pub use cabal::{
32    CabalDownloadOptions, CabalInstallResult, CabalVersion, KNOWN_CABAL_VERSIONS,
33    RECOMMENDED_CABAL_VERSION, cabal_download_url, download_and_install_cabal, get_active_cabal,
34    is_known_version as is_known_cabal_version, is_valid_version as is_valid_cabal_version,
35    known_versions as known_cabal_versions, list_installed as list_installed_cabal, remove_cabal,
36    set_active_cabal,
37};
38pub use check::{AutoInstallPolicy, ToolchainCheck, check_requirements, ensure_toolchain};
39pub use detect::{DetectedTool, ToolStatus, Toolchain};
40pub use ghc::{
41    DownloadOptions, GhcSource, GhcVersion, InstallResult, InstallSource, InstalledCabal,
42    InstalledGhc, Platform, RECOMMENDED_GHC_VERSION, ResolutionConfig, ResolvedGhc,
43    ToolchainManifest, create_symlinks, download_and_install_ghc, get_active, get_path_with_ghc,
44    ghc_download_url, is_known_version, is_valid_version, known_versions, list_installed,
45    remove_ghc, remove_symlinks, resolve_ghc, set_active,
46};
47pub use install::{
48    InstallStrategy, SmartCabalInstallOptions, SmartInstallOptions, install_cabal_smart,
49    install_ghc_smart,
50};