keel-dyn: Load native shared libraries at run time, cross-platform

[ foreign, library, mit, system ] [ Propose Tags ] [ Report a vulnerability ]

Cross-platform runtime loading and symbol resolution for native shared libraries: LoadLibraryExW/GetProcAddress on Windows, dlopen/dlsym elsewhere. . This package is the keystone of the keel project: every native capability (OpenBLAS, ONNX Runtime, ...) is resolved at run time through it, so no keel package ever carries a build-time C dependency and cabal install can never fail on a missing native library.


[Skip to Readme]

Modules

  • Keel
    • Keel.Dyn
      • Keel.Dyn.Locate

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.20 && <4.23), directory (>=1.3 && <1.4), filepath (>=1.4 && <1.6), unix (>=2.8 && <2.9) [details]
Tested with ghc ==9.10.3 || ==9.12.4 || ==9.14.1
License MIT
Author Zhe Zhang
Maintainer Zhe Zhang
Uploaded by azng_0 at 2026-08-19T23:30:26Z
Category System, Foreign
Home page https://github.com/skymanbp/keel
Bug tracker https://github.com/skymanbp/keel/issues
Source repo head: git clone https://github.com/skymanbp/keel
Distributions
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 1 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-08-19 [all 2 reports]

Readme for keel-dyn-0.1.0.0

[back to package description]

keel-dyn

Load native shared libraries at run time, cross-platform: LoadLibraryExW/GetProcAddress on Windows, dlopen/dlsym elsewhere.

This package is the keystone of the keel project: every native capability (OpenBLAS, ONNX Runtime, ...) is resolved at run time through it, so no keel package carries a build-time C dependency and cabal install can never fail on a missing native library.

import Keel.Dyn

main :: IO ()
main = do
  r <- withLibrary "libcrypto.so.3" $ \lib -> do
    Right fp <- resolveSym lib "OpenSSL_version_num"
    callVersionNum fp   -- your own "dynamic" wrapper for the C signature
  print r

Keel.Dyn.Locate adds the keel search policy on top: an env-var override, the per-user keel data directory, then the system search path. On Windows the loader never consults the current directory (DLL-planting hazard); PATH is walked explicitly instead.

Failure is data, not an exception: loading and symbol resolution return Either DynError.

Part of the keel workspace — see the project repository for the other packages (keel-abi, keel-linalg, keel-onnx, and the keel umbrella).