Skip to content


Subversion checkout URL

You can clone with
Download ZIP


can't install hamtmap #1

roti opened this Issue · 1 comment

3 participants



When I try to "cabal install" hamtmap, I get an error:

[roti@mypc ~]$ cabal install hamtmap
Resolving dependencies...
Configuring hamtmap-0.3...
Building hamtmap-0.3...
Preprocessing library hamtmap-0.3...
[1 of 2] Compiling Data.BitUtil ( Data/BitUtil.hs, dist/build/Data/BitUtil.o )

Could not deduce (Eq b) arising from a use of loop'
from the context (Bits a, Num b)
bound by the type signature for
bitmapToIndices :: (Bits a, Num b) => a -> [b]
at Data/BitUtil.hs:(20,1)-(24,83)
Possible fix:
add (Eq b) to the context of
the type signature for
bitmapToIndices :: (Bits a, Num b) => a -> [b]
In the expression: loop 0 bitmap
In an equation for
bitmapToIndices bitmap
= loop 0 bitmap
loop _ 0 = []
loop 32 _ = []
loop ix bitmap
| bitmap .&. 1 == 0 = loop (ix + 1) (bitmap shiftR 1)
| otherwise = ix : (loop (ix + 1) (bitmap shiftR 1))
cabal: Error: some packages failed to install:
hamtmap-0.3 failed during the building phase. The exception was:
ExitFailure 1

@exclipy exclipy closed this
@cbiffle cbiffle referenced this issue from a commit
@nikita-volkov nikita-volkov Fix constraints 75ae68a

I can confirm this on GHC 7.4.2. Num a does not appear to imply Eq a here, from reading the sources of even the latest version of base.

Interestingly, the Haskell '98 report describes Num a as implying both Eq a and Show a -- yet this does not appear to be the case in GHC.

We are not the first to have encountered this -- a StackOverflow post from September '13 raises the same issue in a different context.

@exclipy - are you using a different Haskell implementation, or perhaps a language option?

For posterity, exclipy has merged a pull request that should fix this in hamtmap 0.3.1, which does not yet appear to be available through Hackage as of this writing. You can pull master from the git repo if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.