# "Used tuple of size \> 5!"... but where?

**URL:** <https://forum.canton.network/t/used-tuple-of-size-5-but-where/5939>\
**Category:** App Development\
**Tags:** daml, daml-finance\
**Created:** [January 11, 2023, 5:18pm UTC](https://forum.canton.network/t/used-tuple-of-size-5-but-where/5939 "2023-01-11T17:18:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WallaceKelly](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/wallacekelly/32/5046_2.png) [@WallaceKelly](https://forum.canton.network/u/WallaceKelly)\
**Post date:** [January 11, 2023, 5:18pm UTC](https://forum.canton.network/t/used-tuple-of-size-5-but-where/5939/1 "2023-01-11T17:18:32Z")

</div>

If you `daml build` the [daml-finance-app](https://github.com/digital-asset/daml-finance-app), you get the following warning:

```haskell
File: src/daml/Daml/Finance/Setup/Scenario/OtcSwaps.daml
Hidden: no
Range: 24:1-24:4
Source: Core to Daml-LF
Severity: DsWarning
Message: Used tuple of size > 5! Daml only has Show, Eq, Ord instances for tuples of size <= 5.

```

I understand [the issue](https://discuss.daml.com/t/deriving-eq-and-show-for-tuples-having-more-than-5-elements/4271) and the fact that [the Show type class is only defined for up to five-element tuples](https://github.com/digital-asset/daml/blob/03a76f4a6158449cfad904cbd9730a7458c37d08/compiler/damlc/daml-prim-src/GHC/Show.daml#L172).

What I cannot figure out is _why does [OtcSwaps.daml](https://github.com/digital-asset/daml-finance-app/blob/24966457a09bfcf692f53a13cf797d52c09e0834/src/daml/Daml/Finance/Setup/Scenario/OtcSwaps.daml) trigger this warning?_

I see tuples…

- of size two `("Public", singleton public)`, `("USD", cashRoute)`, etc…
- of size three `(ty, tm, td)`

…but nothing of size \> 5.

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [January 11, 2023, 6:01pm UTC](https://forum.canton.network/t/used-tuple-of-size-5-but-where/5939/2 "2023-01-11T18:01:38Z")

</div>

Hi @WallaceKelly,

You’ll have to wait for a compiler engineer to confirm, but my suspicion is that line 28:

```haskell
    all@[operator, public, centralBank, seller, buyer] = map (.id) parties

```

generates a large tuple as part of its desugaring, and the warning is based on the desugared code representation rather than the actual code.

This is supported by the fact that breaking down that line into (with an appropriate `import DA.List ((!!), head)`):

```haskell
    all = map (.id) parties
    operator = head all
    public = all !! 1
    centralBank = all !! 2
    seller = all !! 3
    buyer = all !! 4

```

gets rid of the warning, at least for me.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 11, 2023, 8:17pm UTC](https://forum.canton.network/t/used-tuple-of-size-5-but-where/5939/3 "2023-01-11T20:17:37Z")

</div>

This is a bug. It has already been fixed in 2.5.0. For some reason the finance app was still stuck on an older snapshot. Upgraded in [Upgrade to 2.5.0 by cocreature · Pull Request #82 · digital-asset/daml-finance-app · GitHub](https://github.com/digital-asset/daml-finance-app/pull/82)
