1

I've installed the Gloss graphics library with cabal. I also installed the gloss examples package.

Now I want to test the examples. This may seem like a silly question, but how do I actually use the package gloss-examples? I understand I can now import the gloss library to a haskell module but how do I test the gloss-examples I installed i.e. how do I use the gloss-example package?

duplode
  • 33,731
  • 7
  • 79
  • 150
user5846939
  • 415
  • 4
  • 11
  • Really? Not a single person that has used the gloss examples that can tell me how? – user5846939 Feb 16 '17 at 19:56
  • 2
    Seriously, you say that after a half hour? Don't expect real-time interaction on stack overflow. If you'd like timely interaction then I suggest you join the IRC channel. – Thomas M. DuBuisson Feb 16 '17 at 20:16
  • @OfeliavanAnalhard The people who answer on SO are doing so for free. You've asked lots of questions but never answered any - why should you expect others to answer when you don't? – Alec Feb 16 '17 at 20:41
  • @OfeliavanAnalhard Also, I've noticed you've ever only accepted one answer to questions you've asked. That would be a good way to start giving back to the community – Alec Feb 16 '17 at 21:00

2 Answers2

2

Building gloss-examples produces a handful of executables, as specified by the Executable entries in the .cabal file. (Another telltale sign of executable-only packages is the lack of entries for modules at the front page of the Hackage docs.) In Linux, the default destination of such executables is ~/.cabal/bin. According to the answers to this question, in OS X the default is ~/Library/Haskell/bin/cabal, unless you are using the Homebrew package manager, which changes it to ~/.cabal/bin. In Windows, it is %APPDATA%\cabal\bin. See also: the Installation paths section in Cabal's user guide.

Community
  • 1
  • 1
duplode
  • 33,731
  • 7
  • 79
  • 150
0

The gloss-examples package does not install any modules and you do not work with it as a library. Instead, it builds executables (see here) under the names gloss-*. Just run those executables which are wherever you have cabal installing the binaries (typically $HOME/.cabal/bin).

Thomas M. DuBuisson
  • 64,245
  • 7
  • 109
  • 166
  • I navigated to my .cabal folder (which is hidden) through the terminal using sudo. But there is no folder there called bin, and there are no executables. The only trace of the examples are two unpacked archive files gloss-examples-1.10.2.4.tar.gz and gloss-examples-1.10.2.4.tar.gz.etag inside an folder named gloss-examples. Where are the executables? – user5846939 Feb 16 '17 at 20:25
  • 1. You shouldn't need `sudo` - that you seemed to need to suggests another problem. Perhaps you installed something with sudo (bad) and the permissions are now incorrect which prevents `cabal install` from functioning properly? 2. The examples are where-ever you have cabal installing them. Did you use `cabal install gloss-examples`? What was the output? Is there a sandbox in the directory where you executed `cabal install`? – Thomas M. DuBuisson Feb 16 '17 at 21:20