I am developing a love/hate relationship with Haskell libraries. Really want to learn Haskell in depth no matter what, but the libraries are trying to discourage me most of the time (or encourage me to write me own, but I am not quite there yet). Wanted to try Wx for UI. Cabal starts all cheerful but ends with a message from hell. At least I think it is.
Downloading the latest package list from hackage.haskell.org
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Resolving dependencies...
Downloading fgl-5.7.0.1...
Downloading old-locale-1.0.0.7...
Configuring old-locale-1.0.0.7...
Downloading stm-2.5.0.0...
Configuring fgl-5.7.0.1...
Configuring stm-2.5.0.0...
Building old-locale-1.0.0.7...
Building fgl-5.7.0.1...
Building stm-2.5.0.0...
Installed old-locale-1.0.0.7
Downloading old-time-1.1.0.3...
Configuring old-time-1.1.0.3...
Building old-time-1.1.0.3...
Installed stm-2.5.0.0
Installed old-time-1.1.0.3
Downloading wxcore-0.11.1.2...
Configuring wxcore-0.11.1.2...
Failed to install wxcore-0.11.1.2
Build log ( /Users/administrator/.cabal/logs/ghc-8.4.3/wxcore-0.11.1.2-7WkQ04B76zVGNKKljmrN1g.log ):
cabal: Entering directory '/var/folders/81/50s00bl11pv7fn8dw4n0w03m0000gn/T/cabal-tmp-1098/wxcore-0.11.1.2'
error: Unknown option "--sysconfdir=/Users/administrator/Library/Haskell/etc". Use "--help" to show valid options.
cabal: Leaving directory '/var/folders/81/50s00bl11pv7fn8dw4n0w03m0000gn/T/cabal-tmp-1098/wxcore-0.11.1.2'
Installed fgl-5.7.0.1
Updating documentation index
/Users/administrator/Library/Haskell/share/doc/x86_64-osx-ghc-8.4.3/index.html
cabal: Error: some packages failed to install:
wx-0.11.1.2-3RIijI82LEqAoB6cQuvIlr depends on wx-0.11.1.2 which failed to
install.
wxcore-0.11.1.2-7WkQ04B76zVGNKKljmrN1g failed during the configure step. The
exception was:
ExitFailure 2
Any advise? Please don't say 'use Gtk' because that's even worse. Would be great if someone can help me out. Although the terminal is a safe place to reside, I want to eventually break out of it and discover the world. "Hello world!"
Haskell grew out of the needs of a diverse group of researchers that needed a common functional language definition and implementation. Many of the researchers are actively involved in theory of programming languages and theory of functional programming, so they will extend or re-define the language to meet their needs. The ecosystem has a diverse set of libraries, many of which were not developed to the level of professionally-maintained software.
That being said, with Haskell starting to reach acceptance with large corporations, there is a substantial push to get real with providing a language and a set of libraries that work together.
The most concerted effort that I have seen is Haskell Stack. They start with the stack tool, which is a package manager and build tool; it uses cabal for download and installation and (usually) ghc for compilation, as well as whatever build tools you have on your computer. Stack uses an lts (long-term support, I think) profile that identifies a set of package versions that are known to work with each other. You can tell stack to use a particular lts profile for your project, and it will maintain that as part of your build profile, even when you add specific packages.
From your build output, you are trying to use the latest packages from hackage.haskell.org. Each package gets updated in its own time frame, quite separately from any other package. The stack approach is identify the packages that work together, which often means that older versions of the compiler might be required.
As I remember, the latest Wx Haskell doesn't work on Mac OS X. There may be a stack lts profile that can be used to get Wx Haskell working on Mac OS X.