<p>The issue was that in <code>hashable-1.3.4.0</code>, the instance was added, and it <a href="https://input-output-hk.github.io/ouroboros-network/byron-spec-ledger/src/Byron.Spec.Ledger.Update.html#local-6989586621679556982" rel="nofollow noreferrer">was also defined in the <code>byron-spec-ledger</code> package</a>.</p>
<p>Adding this constraint to my <code>cabal.project</code> file solved the issue:</p>
<pre><code>constraints:
    hashable &lt; 1.3.4.0
</code></pre>

CC BY-SA 4.0
2021-11-14T14:06:24.737Z
2021-11-14T14:06:24.737Z
sevcsik
<p>I'm trying to add <code>cardano-wallet-core</code> as a dependency to my Haskell project, so I can use the servant client. But I get this error when cabal builds the <code>byron-spec-ledger</code> package:</p>
<pre><code>[ 6 of 16] Compiling Byron.Spec.Ledger.Update ( src/Byron/Spec/Ledger/Update.hs, dist/build/Byron/Spec/Ledger/Update.o, dist/build/Byron/Spec/Ledger/Update.dyn_o )

src/Byron/Spec/Ledger/Update.hs:236:10: error:
    Duplicate instance declarations:
      instance Hashable a =&gt; Hashable (Set a)
        -- Defined at src/Byron/Spec/Ledger/Update.hs:236:10
      instance Hashable v =&gt; Hashable (Set v)
        -- Defined in `hashable-1.3.4.1:Data.Hashable.Class'
    |
236 | instance Hashable a =&gt; Hashable (Set a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build byron-spec-ledger-0.1.0.0 (which is required by
</code></pre>
<p>My <code>cabal.project</code> looks like this: <a href="https://pastebin.com/swdJWBAK" rel="nofollow noreferrer">https://pastebin.com/swdJWBAK</a></p>
<p>Using GHC 8.10.4.</p>

CC BY-SA 4.0
2021-11-16T12:40:10.320Z
Thank you, this worked for me as well.
Charles Arthur Wuthrich III
<wallet><haskell>
How to fix Duplicate instance declaration error in byron-spec-ledger package?
# How to fix Duplicate instance declaration error in byron-spec-ledger package?

(Asked by: username_0 on 2021-11-14)

I'm trying to add cardano-wallet-core as a dependency to my Haskell project, so I can use the servant client. But I get this error when cabal builds the byron-spec-ledger package:
[ 6 of 16] Compiling Byron.Spec.Ledger.Update ( src/Byron/Spec/Ledger/Update.hs, dist/build/Byron/Spec/Ledger/Update.o, dist/build/Byron/Spec/Ledger/Update.dyn_o )

src/Byron/Spec/Ledger/Update.hs:236:10: error:
    Duplicate instance declarations:
      instance Hashable a => Hashable (Set a)
        -- Defined at src/Byron/Spec/Ledger/Update.hs:236:10
      instance Hashable v => Hashable (Set v)
        -- Defined in `hashable-1.3.4.1:Data.Hashable.Class'
    |
236 | instance Hashable a => Hashable (Set a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build byron-spec-ledger-0.1.0.0 (which is required by

My cabal.project looks like this: https://pastebin.com/swdJWBAK
Using GHC 8.10.4.

**Tags:** wallet, haskell
> **Comments:**
> **username_1**: Thank you, this worked for me as well.  

---

## 1 answers

### Answer by username_0 on 2021-11-14. Score: 2

The issue was that in hashable-1.3.4.0, the instance was added, and it was also defined in the byron-spec-ledger package.
Adding this constraint to my cabal.project file solved the issue:
constraints:
    hashable < 1.3.4.0


---

