nh2 / hemokit

Haskell library for the Emotiv EEG, inspired by the Emokit code
31 stars 13 forks source link

Problem compiling / Not in scope: type constructor or class ‘NFData’ #9

Open pklaus opened 8 years ago

pklaus commented 8 years ago

While trying to install hemokit on an up-to-date (ghc v8.0.1) Arch Linux system I got the following error message(s):

[...]
src/Hemokit.hs:530:10: error:
    Not in scope: type constructor or class ‘NFData’
    Perhaps you meant ‘Data’ (imported from Data.Data)
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
hemokit-0.6.6 failed during the building phase. The exception was:
ExitFailure 1

I could fix it by adding the following line again in ./src/Hemokit.hk:

import Control.DeepSeq

That line was previously changed to import Control.DeepSeq.Generics in 83c208d but it seems both lines are required now.


Other than that, I also had to remove the executable hemokit-mouse section in the hemokit.cabal file. Its dependency on robot, which in turn depends on xhb, could not satisfied: the installation of xhb fails on my system with the error message

Ambiguous occurrence ‘putInt8’

So far, I have no idea how to fix this but it's definitely an upstream bug in xhb.

melyndaschreiber commented 8 years ago

Ran into this issue today. I am running on windows10. I fixed the problem by installing and then adding import Control.DeepSeq at the top of src/hemokit.hs (as you suggested). Initially, I was trying to load previous releases and ran into the xhb problem. Not sure what hemokit release you were running. If you haven't tried already, you should try hemokit-0.6.6.

Now I am running into the basic, "hemokit-dump: user error (no devices found)" . I will post this problem elsewhere if it persists.

nh2 commented 8 years ago

@pklaus Yes with GHC 8 and corresponding base and dependent libraries the NFData stuff moved a bit, if you can check that your fix also works with older GHC versions I'll happily merge a PR for that (or you have to wait until I get around to it :D).

So far, I have no idea how to fix this but it's definitely an upstream bug in xhb.

@pklaus that can most certainly be fixed by using a import qualified instead of import in xhb and resolving the ambiguous occurrence that way (or one import can be deleted, I can imagine that the putInt8 function made its way into a more upstream library too and is thus in scrope once via that library and once via the helper library that xhb used originally).

Now I am running into the basic, "hemokit-dump: user error (no devices found)" . I will post this problem elsewhere if it persists.

@LadyTech check that you have the udev rule installed so that your user can access the device.

nh2 commented 8 years ago

While trying to install hemokit on an up-to-date (ghc v8.0.1)

@pklaus I recommend you build hemokit with stack. stack build should do it for you. stack can automatically get you a fitting version of GHC, so that you don't need to deal with the fallout of upgrading to GHC 8.

nh2 commented 8 years ago

(Also note I just pushed a small update to use latest Stackage LTS for stack build.)