I am not able to use stack

25 views
Skip to first unread message

Eduardo Costa

unread,
Jul 23, 2019, 9:59:01 AM7/23/19
to haskell-stack
I have been trying to use stack for some time without success. Is there an easy way to configure stack so that I can install a few packages, just to try Haskell on something non-trivial?  I have stack in my machine configured with the latest version of ghc:

~/hs$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5

The problem is that the only thing that I have managed to do with stack, so far, is to discover the ghc version. For instance, I tried to install the yi editor without success using many different methods, such as cabal. Then I tried stack, thus:

~/hs$ stack install yi --flag yi:vty

Stack starts complaining about dependences, and suggests that I add a an extra-deps section to ~/.stack/global-project/stack.yaml, which I did. Then it takes a long time performing downloads, until it gives up with an unrecoverable error message:

yi-core           > /private/var/folders/7d/mwm1yx257sg8z5y12h77cy440000gn/T/stack89879/yi-core-0.18.0/src/Yi/Buffer/Misc.hs:873:3-30: error:
yi-core           >     • No instance for (Control.Monad.Fail.MonadFail BufferM)
yi-core           >         arising from a do statement
yi-core           >         with the failable pattern ‘Just !ms’
yi-core           >     • In a stmt of a 'do' block: Just !ms <- getMarks =<< ask
yi-core           > 873 |   Just !ms <- getMarks =<< ask
yi-core           >     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I tried stack with many other packages, such as Berp (a compiler for Python), Pugs (implementation of Perl 6), haspy (Python), Jhc, rasa, without any success. I wonder if Haskell has something that works flawlessly and fast, as quicklisp or roswell in Common Lisp. For instance, I installed the lem text editor with roswell just typing the line below:

~$ ros install cxxxr/lem

I also installed compilers and interpreters for Python, Fortran, Prolog (wamlisp) and other languages with equal facility, this time using quicklisp. For instance:

~$ rlwrap sbcl
* (ql:quickload :cl-python)

Very complex packages, such as Maxima Computer Algebra, install easily in Common Lisp. Another thing that I consider very important is that sbcl posts a new version of the compiler every month. All versions work perfectly well, and old software works with all versions. I believe that I am doing something very wrong with stack, cabal and Haskell, since any moderately complex package simply does not install.







Michael Snoyman

unread,
Jul 23, 2019, 10:06:38 AM7/23/19
to Eduardo Costa, haskell-stack
yi is not present in recent Stackage snapshots. I'm not particularly fond of Stack's behavior in this case; I'd rather it be more explicit about adding packages outside of a snapshot. In any event, if you check out the yi page on stackage.org[1], you can see that the last snapshot to include yi is 2016-10-10. You should have more success using that snapshot with:

    stack install --resolver nightly-2016-10-10

If someone wants to make it easier to install yi with Stack, adding it back to Stackage would be the easiest way.


--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/307686d2-7605-4f86-9c86-1d5b483cbd47%40googlegroups.com.

Eduardo Costa

unread,
Jul 23, 2019, 10:25:46 AM7/23/19
to Michael Snoyman, haskell-stack
Hi, Michael, I am trying your suggestion right now. I typed:

~/hs$ stack install yi --flag yi:vty --resolver nightly-2016-10-10

It seems that stack started by installing an old version of ghc. It is interesting, but new versions of sbcl always work with older programs. Does Haskell need old compiler versions for older programs? It seems that there is no effort to keep backward compatibility. 

Michael Snoyman

unread,
Jul 23, 2019, 10:28:39 AM7/23/19
to Eduardo Costa, haskell-stack
That is in fact sometimes the case, yes.
Reply all
Reply to author
Forward
0 new messages