can't install hamtmap #1

Closed
roti opened this Issue Mar 12, 2013 · 1 comment

Comments

Projects
None yet
3 participants
@roti

roti commented Mar 12, 2013

Hi,

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 )

Data/BitUtil.hs:20:26:
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 forbitmapToIndices':
bitmapToIndices bitmap
= loop 0 bitmap
where
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

@cbiffle

This comment has been minimized.

Show comment Hide comment
@cbiffle

cbiffle May 18, 2014

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.

cbiffle commented May 18, 2014

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