trying to install iHaskell - conflicting versions of hLint - haskell

According to the iHaskell page it should be possible to install from Hackage
cabal install ihaskell
However, when I do so it fails to install certain packages:
...
[ 7 of 44] Compiling HsColour ( src/HsColour.hs, dist/build/HsColour.o )
src/HsColour.hs:25:16:
Couldn't match type `Int' with `[Char]'
Expected type: String -> String
Actual type: Int -> String -> String
In the return type of a call of `CSS.hscolour'
Probable cause: `CSS.hscolour' is applied to too few arguments
In the expression: CSS.hscolour False
In an equation for `hsColourHTML':
hsColourHTML = CSS.hscolour False
Failed to install hlint-1.9.10
cabal: Error: some packages failed to install:
hlint-1.9.10 failed during the building phase. The exception was:
ExitFailure 1
ihaskell-0.5.0.0 depends on hlint-1.9.10 which failed to install.
Suggesting something about hlint-1.9.10. However, hlint-1.9.17 is in fact present.
ubuntu:~$ hlint -V
HLint v1.9.17, (C) Neil Mitchell 2006-2015

Related

Haskell error with cabal: no instance for

I'm trying to follow the steps for installation for derivation of software product lines called hephaestus-pl. However, at the time of performing the installation steps, according to the tutorial, there is an error when executing the cabal install command on all cloned repositories. The erros is:
$ sudo cabal install
Resolving dependencies...
Notice: installing into a sandbox located at
/home/notebook/workspace/hephaestus/hephaestus-sb
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Failed to install funsat-0.6.2
Build log ( /home/notebook/workspace/hephaestus/hephaestus-sb/logs/funsat-0.6.2.log ):
cabal: Entering directory '.'
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Preprocessing library funsat-0.6.2...
[ 4 of 10] Compiling Funsat.Monad ( src/Funsat/Monad.hs, dist/dist-sandbox-cf02e0bc/build/Funsat/Monad.o )
src/Funsat/Monad.hs:64:10: error:
• No instance for (Applicative (SSTErrMonad e st s))
arising from the superclasses of an instance declaration
• In the instance declaration for ‘Monad (SSTErrMonad e st s)’
src/Funsat/Monad.hs:88:10: error:
• Could not deduce (GHC.Base.Alternative (SSTErrMonad e st s))
arising from the superclasses of an instance declaration
from the context: Error e
bound by the instance declaration at src/Funsat/Monad.hs:88:10-52
• In the instance declaration for ‘MonadPlus (SSTErrMonad e st s)’
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
funsat-0.6.2 failed during the building phase. The exception was:
ExitFailure 1
I'm using the following version of ghci, which came installed along with the haskell-platform:
$ ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
The cabal version is:
$ cabal --version
cabal-install version 1.24.0.1
compiled using version 1.24.1.0 of the Cabal library
My operating system is debian 9.2.
This is failing to compile due to the Functor/Applicative/Monad proposal implemented in more recent versions of GHC. The code would originally have compiled just fine, but in recent versions of GHC, you cannot declare something as Monad without first declaring it as Functor and Applicative. You used to be able to, but now you cannot.
The library authors need to update the library's code to fix this new restriction.

How to build Stack Yesod?

I've been trying to use stack to start a yesod-simple project, but nothing I do will build this project. I've looked into other similar stackoverflow questions but couldn't get this to work. Can some one help me figure out what I need to do to get started?
Error
> stack build
Populated index cache.
yesod-persistent-1.4.0.6: configure
yesod-persistent-1.4.0.6: build
yesod-persistent-1.4.0.6: copy/register
yesod-form-1.4.9: configure
yesod-form-1.4.9: build
yesod-form-1.4.9: copy/register
yesod-auth-1.4.15: configure
yesod-auth-1.4.15: build
Progress: 3/6
-- While building package yesod-auth-1.4.15 using:
/Users/scottyluciano/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/scottyluciano/Documents/tutorials/practice/.stack-work/logs/yesod-auth-1.4.15.log
Configuring yesod-auth-1.4.15...
Building yesod-auth-1.4.15...
Preprocessing library yesod-auth-1.4.15...
[ 1 of 12] Compiling Yesod.PasswordStore ( Yesod/PasswordStore.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Yesod/PasswordStore.o )
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/PasswordStore.hs:166:31: Warning:
Defaulting the following constraint(s) to type ‘Integer’
(Integral b0)
arising from a use of ‘^’ at Yesod/PasswordStore.hs:166:31
(Num b0)
arising from the literal ‘32’ at Yesod/PasswordStore.hs:166:32-33
In the first argument of ‘(-)’, namely ‘2 ^ 32’
In the first argument of ‘(*)’, namely ‘(2 ^ 32 - 1)’
In the second argument of ‘(>)’, namely ‘(2 ^ 32 - 1) * hLen’
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/PasswordStore.hs:419:1: Warning:
Defined but not used: ‘toStrict’
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/PasswordStore.hs:422:1: Warning:
Defined but not used: ‘fromStrict’
[ 2 of 12] Compiling Yesod.Auth.Message ( Yesod/Auth/Message.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Yesod/Auth/Message.o )
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/Auth/Message.hs:24:1: Warning:
The import of ‘mappend’ from module ‘Data.Monoid’ is redundant
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/Auth/Message.hs:460:1: Warning:
Pattern match(es) are overlapped
In an equation for ‘finnishMessage’: finnishMessage Password = ...
/private/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/stack64861/yesod-auth-1.4.15/Yesod/Auth/Message.hs:460:1: Warning:
Pattern match(es) are non-exhaustive
In an equation for ‘finnishMessage’:
Patterns not matched: CurrentPassword
[ 3 of 12] Compiling Yesod.Auth.Routes ( Yesod/Auth/Routes.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Yesod/Auth/Routes.o )
[ 4 of 12] Compiling Yesod.Auth ( Yesod/Auth.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Yesod/Auth.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.3 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/ghc65133_0/libghc_21.dylib, 5): no suitable image found. Did find:
/var/folders/kl/yp2gqzf116131b5gvs9pzttw0000gn/T/ghc65133_0/libghc_21.dylib: malformed mach-o: load commands size (36784) > 32768
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
GHC 8.0.2 fixes the panic issue. By changing LTS to 8.0, the upgrade resolves all issues.

Cannot build leksah 0.15.2.0 on linux

When I try to build the latest leksah (using these instructions), I get this error:
src/IDE/TextEditor/CodeMirror.hs:225:38-56:
Couldn't match type ‘Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase.OpaqueJSContext’
with ‘webkit-javascriptcore-0.13.1.1:Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase.OpaqueJSContext’
NB: ‘Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase.OpaqueJSContext’
is defined in ‘Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase’
in package ‘webkitgtk3-javascriptcore-0.13.1.0’
‘webkit-javascriptcore-0.13.1.1:Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase.OpaqueJSContext’
is defined in ‘Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase’
in package ‘webkit-javascriptcore-0.13.1.1’
Expected type: JSContextRef
Actual type: Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase.JSGlobalContextRef
In the ‘cmContext’ field of a record
In the second argument of ‘($)’, namely ‘CodeMirrorState {..}’
cabal: Error: some packages failed to install:
leksah-0.15.2.0 failed during the building phase. The exception was:
ExitFailure 1
Does anyone know how to fix this?

Cabal error for llvm-general

Trying to install llvm-general-3.3.5.
Have a local ghc-7.6.3 installation so used the following command to configure the llvm-general package after downloading the binary:
runhaskell Setup configure --user --/path/to/local --with-compiler=7.6.3
as is suggested in the haskell.org pages here.
That gets this error:
Setup.hs:42:13:
Couldn't match expected type `ProgramSearchPath
-> IO (Maybe FilePath)'
with actual type `IO (Maybe FilePath)'
In the return type of a call of `findJustBy'
Probable cause: `findJustBy' is applied to too many arguments
In the expression:
findJustBy (findProgramLocation v) llvmConfigNames
In the expression:
\ v -> findJustBy (findProgramLocation v) llvmConfigNames
Removing the configure options gets the same result.
Any ideas?
I'm on a Scientific linux machine.
Thank you!

How to install generic haskell

after install hugs and then install ghc6 then install generic-haskell has the following message, How to do?
# make package
Creating generic-haskell package ...
ghc-pkg: cannot find package generic-haskell
Reading package info from "generic-haskell.cabal.pkg" ... done.
generic-haskell-1.80: missing id field
generic-haskell-1.80: dependency "base-4.2.0.0" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "haskell98-1.0.1.1" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "containers-0.3.0.0" doesn't exist (use --force to override)
make: *** [package] Error 1
in ubuntu i compile ghc-6.2.2 got the following error
/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O HaskTags.hs
on the commandline:
Warning: -optdep-f is deprecated: Use -dep-makefile instead
------------------------------------------------------------------------
==fptools== make boot - --no-print-directory -r;
in /home/martin/ghc-6.2.2/ghc/utils/ghc-pkg
------------------------------------------------------------------------
/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs Version.hs
on the commandline:
Warning: -optdep-f is deprecated: Use -dep-makefile instead
make all
/usr/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY -c Main.hs -o Main.o -ohi Main.hi
Main.hs:496:11:
Ambiguous type variable `e' in the constraint:
`Exception.Exception e'
arising from a use of `Exception.throw' at Main.hs:496:11-25
Possible cause: the monomorphism restriction applied to the following:
my_catch :: forall a. IO a -> (e -> IO a) -> IO a
(bound at Main.hs:499:0)
my_throw :: forall a. e -> a (bound at Main.hs:496:0)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
Main.hs:498:13:
Ambiguous type variable `e1' in the constraint:
`Exception.Exception e1'
arising from a use of `Exception.catch' at Main.hs:498:13-27
Possible cause: the monomorphism restriction applied to the following:
eval_catch :: forall a. a -> (e1 -> IO a) -> IO a
(bound at Main.hs:498:0)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
make[4]: *** [Main.o] Error 1
make[3]: *** [boot] Error 2
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1
Any one have installed old version of GHC and generic haskell in ubuntu 10?
There are many pairs of version , i tried ghc-6.2.2 got above error, will i need to uninstall ubuntu 10 to install older version ubuntu to get it work? which version of ubuntu for which version of ghc work?
http://www.cs.uu.nl/research/projects/generic-haskell/compiler.html
I tried installing generic-haskell myself from the source, I managed, and am able to describe how I fixed it. My installation platform is the Haskell Platform 2011.2.0.1-x86_64, but the following instruction are somewhat more general.
I met three problems, including the first one you describe (no. 3 below). For other users, I also describe the first two ones, which you probably solved as well.
1) Other users have first to fix an error depending on Data.Map.lookup type having changed, for containers >= 0.2.0.0: it used to return Monad m => m b (in containers-1.0.0.0), now it returns just Maybe b.
I added calls to Data.Maybe.maybeToList to fix a few call-sites needing to use a list type; I bet you fixed the same error in some way. You can find this fix at:
http://hpaste.org/47624.
2) Another error I had, with GHC 7, is that the configure script does not realize that it is newer than GHC 6.8, so it needs to also depend on containers. configure output included this line:
checking whether base package is split (GHC 6.8 or newer)... no
To fix this, you need to replace
if test $ghc_ma -ge 6 -a $ghc_mi -ge 8; then
with
if test $ghc_ma -eq 6 -a $ghc_mi -ge 8 -o $ghc_ma -ge 7; then
3) To fix your problem, you need to edit build/generic-haskell.cabal.pkg (assuming you are not doing an in-place installation with make in-place). You need to add an id: line and fix the depends line to use package-ids of packages present on your systems instead of package names. You can find out the ids using the following commands (output on my system included):
$ ghc-pkg field base id
id: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
$ ghc-pkg field haskell98 id
id: haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
$ ghc-pkg field containers id
id: containers-0.4.0.0-b4885363abca642443ccd842502a3b7e
The change to build/generic-haskell.cabal.pkg would then be:
-depends: base-4.3.1.0
- haskell98-1.1.0.1
- containers-0.4.0.0
+depends: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
+ haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
+ containers-0.4.0.0-b4885363abca642443ccd842502a3b7e
Furthermore, you need to add an id line to the same file - any id will do, as long as you change it if/when you reinstall the library. Here I've used:
id: generic-haskell-1.80-lib-md5sum-2a7ae9d60440627618ad0b0139ef090b
I've also aligned all fields with spaces, as in the existing files. The syntax reference for this file can be found in:
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/packages.html#installed-pkg-info
Apparently, the generic-haskell package depends on an old version of base.
The Haskell Platform specifies base-4.3.1.0, while generic-haskell needs an older version. Please contact the maintainers, or possibly, install an older version of GHC.

Resources