ghci-with 645 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh -e
  2. if [ $# -lt 1 ]; then
  3. echo "Usage: $0 package [package ...]" >&2
  4. exit 1
  5. fi
  6. DIR=$(mktemp -d)
  7. PKG=Temporary
  8. touch $DIR/LICENSE
  9. cat >$DIR/$PKG.hs <<EOF
  10. module $PKG where
  11. EOF
  12. cat >$DIR/$PKG.cabal <<EOF
  13. name: $PKG
  14. version: 0.0.0
  15. license: OtherLicense
  16. license-file: LICENSE
  17. cabal-version: >= 1.10
  18. build-type: Simple
  19. library
  20. default-language: Haskell2010
  21. exposed-modules: $PKG
  22. build-depends: $1,
  23. EOF
  24. shift
  25. for DEP in $@; do
  26. cat >>$DIR/$PKG.cabal <<EOF
  27. $DEP,
  28. EOF
  29. done
  30. cat >>$DIR/$PKG.cabal <<EOF
  31. base
  32. EOF
  33. cd $DIR
  34. cabal new-build
  35. exec cabal new-repl