Skip to content

Instantly share code, notes, and snippets.

@marinelli
Last active August 28, 2025 14:07
Show Gist options
  • Save marinelli/e56b3ad0eef8b7af8de93907e4689953 to your computer and use it in GitHub Desktop.
Save marinelli/e56b3ad0eef8b7af8de93907e4689953 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
_PKGS=("$@")
if [ ${#_PKGS[@]} -eq 0 ]; then
_PKGS=('all' 'all:tests' 'all:benchmarks')
fi
_LOGS=$(mktemp)
export _LOGS
_GHC_OPTIONS='-Wunused-packages -Wno-error=unused-packages'
cabal build --ghc-options "$_GHC_OPTIONS" --jobs=1 "${_PKGS[@]}" 2>&1 | tee "$_LOGS"
printf '\n---\n'
grep -w exposed "$_LOGS" | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment