Can I add extra Haskell library packages to Haskell for Mac?

Yes, this is possible after installing the command line tools from the "Command Line" tab of the app preferences.

Everything is ready and configured to install packages from LTS Haskell as well as local packages whose dependencies are covered by LTS Haskell. After installing the command lines tools, there is a new menu called "Target", which includes a Package Manager.

Have more questions? Submit a request

7 Comments

  • 0
    Avatar
    Kris Shannon

    After you run 'cabal instal' how can you get the package recognised by the Haskell for Mac app?

    e.g.

    'cabal install yesod' worked without any errors

    Adding 'import Yesod' in the GUI comes up with:

    "Could not find module ‘Yesod’
    Use -v to see a list of the files searched for."

  • 0
    Avatar
    Manuel Chakravarty

    You may have to close and re-open the project after you did the installation (or simply re-start Haskell for Mac). (This is somewhat annoying, I am sorry. We will improve this in the future.)

  • 0
    Avatar
    Konstantin Solomatov

    Is it possible to make it install in a different location? Or at least provide some uninstaller. IMO, it's a bad practice to propose to install something which is hard to uninstall.

  • 0
    Avatar
    Manuel Chakravarty

    Thank you for the feedback. We install in /usr/local/bin as this will be picked up without requiring users to alter the PATH variable (to accomodate users who are less familiar with Unix tools). However, you are right in that we need to provide an uninstaller. 

    BTW, this article has further details on the command line tools and their installation: http://community.hfm.io/hc/en-us/articles/216666257-Usage-of-the-command-line-tools

  • 1
    Avatar
    Daniel Schreiber

    Hi,

    I can not install a package with the package manager. I get always that error:

     

    cabal install scalpel-0.5.1 [in temporary directory]
    cd /var/folders/_0/m27b0l1x53xffpy2mpj50000gn/T/runcli.gyvmiNTk
    /usr/local/lib/HaskellCLI.0.2-9.6-2/bin/cabal install scalpel-0.5.1
    Warning: The package list for 'stackage-lts-9.6' is 126 days old.
    Run 'cabal update' to get the latest list of available packages.
    Resolving dependencies...
    Downloading curl-1.3...
    Downloading regex-tdfa-1.2.2...
    Downloading tagsoup-0.14.1...
    Failed to install curl-1.3
    Build log ( /Users/ds/.cabal/logs/curl-1.3.log ):
    /Users/ds/.cabal/logs/curl-1.3.log: openFile: does not exist (No such file
    or directory)
    Fatal error: The operation couldn’t be completed. Script task exited with status 1
    «End of 'cabal install scalpel-0.5.1 [in temporary directory]'»

     

    It also failed to update the package list with 'cabal udpate':

     

    cd /var/folders/_0/m27b0l1x53xffpy2mpj50000gn/T/runcli.BvYgQKqi
    /usr/local/lib/HaskellCLI.0.2-9.6-2/bin/cabal update
    Downloading the latest package list from stackage-lts-9.6
    cabal: Failed to download http://www.stackage.org/lts-9.6/00-index.tar.gz :
    HTTP code 3
    Fatal error: The operation couldn’t be completed. Script task exited with status 1
    «End of 'cabal update [in temporary directory]'»

     

    I tried to update everything, but the error still appears...

  • 1
    Avatar
    Nick Ager

    I am seeing the same issue as Daniel Schreiber (above). I'm using HfM Version 1.6.1, when I try to install any package I see something similar to the log below. I've also tried updating command line tools. When I try to update the package list with::

    /usr/local/lib/HaskellCLI-8.0.2-9.6-2/bin/cabal update

    I see the error:

    Failed to download http://www.stackage.org/lts-9.6/00-index.tar.gz : HTTP code 3

    ----

    usr/local/lib/HaskellCLI.0.2-9.6-2/bin/cabal install uuid-1.3.13
    Warning: The package list for 'stackage-lts-9.6' is 133 days old.
    Run 'cabal update' to get the latest list of available packages.
    Resolving dependencies...
    Downloading cryptohash-md5-0.11.100.1...
    Downloading cryptohash-sha1-0.11.100.1...
    Downloading network-info-0.2.0...
    Failed to install cryptohash-sha1-0.11.100.1
    Build log ( /Users/nickager/.cabal/logs/cryptohash-sha1-0.11.100.1.log ):
    /Users/nickager/.cabal/logs/cryptohash-sha1-0.11.100.1.log: openFile: does not exist (No such file or directory)
    Fatal error: The operation couldn’t be completed. Script task exited with status 1
    «End of 'cabal install uuid-1.3.13 [in temporary directory]'»

    Edited by Nick Ager
  • 0
    Avatar
    Manuel Chakravarty

    I am sorry about this problem with Cabal. It is due to a bug in the version of Cabal that ships with Haskell for Mac and doesn't properly deal with a recent change in the set up of the Stackage package repository. I am working on a new version of Haskell for Mac that, among other things, fixes the issue. In the meantime, could you please manually change the Cabal configuration as follows:

    * Edit the file "~/Library/Containers/com.haskellformac.Haskell.basic/Data/Library/Application\ Support/Cabal/cabal.config"
    * Replace the second line with the following text "remote-repo: stackage-lts-9.6:http://hackage.fpcomplete.com/`". (It is just the URL that actually changes.)

    This should fix the problem for now.

    I am sorry about the inconvenience,
    Manuel

    Edited by Manuel Chakravarty
Please sign in to leave a comment.
Powered by Zendesk