#!/bin/bash
#
# bench/versions: print versions of installed dependencies
#
# Copyright (C) 2021-2025  Rudy Matela
# Distributed under the 3-Clause BSD licence (see the file LICENSE).
get-ghc-v() {
    ghc --version | sed -e "s/.* version/GHC/"
}
ghc-pkg-list() {
	ghc-pkg list "$@"
	ghc-pkg list --package-db ~/.cabal/store/ghc-$(ghc --version | sed -e "s/.* version //")/package.db "$@"
}
get-pkg-v() {
    ghc-pkg-list $1 2>/dev/null |
    grep " $1-" |
    sed -e "s/^ *//" |
    tail -1
}
get-ghc-v
get-pkg-v leancheck
get-pkg-v express
get-pkg-v speculate
