# Plucking constraints in Bluefin

**URL:** <https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579>\
**Category:** Uncategorized\
**Created:** [October 21, 2024, 7:46am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579 "2024-10-21T07:46:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomjaguarpaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomjaguarpaw/32/1230_2.png) [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Post date:** [October 21, 2024, 7:46am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/1 "2024-10-21T07:46:56Z")

</div>

My latest article about Bluefin is called [Plucking constraints in Bluefin](https://h2.jaguarpaw.co.uk/posts/bluefin-plucking-constraints/).

---

<div class="post-metadata">

**Author:** ![sgraf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/sgraf/32/392_2.png) [@sgraf](https://discourse.haskell.org/u/sgraf)\
**Post date:** [October 22, 2024, 6:23am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/2 "2024-10-22T06:23:55Z")

</div>

A nice read!

I think the type variables in the MTL plucking example are not quite right. In the final type, it should be `m'` everywhere.

As coherence is concerned, I think it is important that distinct effects have distinct skolemns `ei`. I guess this in enforced by the `runST`-style type of the effect plucker, wherein the skolemn occurs only in the type of the effect handle.

---

<div class="post-metadata">

**Author:** ![tomjaguarpaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomjaguarpaw/32/1230_2.png) [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Post date:** [October 22, 2024, 7:26am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/3 "2024-10-22T07:26:01Z")

</div>

Thanks!

Oh my, I completely garbled that type. I think this is correct fix: [Fix type signature · tomjaguarpaw/H2@d824546 · GitHub](https://github.com/tomjaguarpaw/H2/commit/d824546d032ae4f275665827efd7f907a9ee69eb). Does that match what you would expect?

I’ve deployed the change.

---

<div class="post-metadata">

**Author:** ![sgraf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/sgraf/32/392_2.png) [@sgraf](https://discourse.haskell.org/u/sgraf)\
**Post date:** [October 22, 2024, 7:39am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/4 "2024-10-22T07:39:36Z")

</div>

Much better. I think it would also help to add that GHC infers the substitution `m' := ExceptT String m` which is why `m'` is no longer present in the final type. Plus, this helps to see where which constraint comes from.

---

<div class="post-metadata">

**Author:** ![tomjaguarpaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomjaguarpaw/32/1230_2.png) [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Post date:** [October 22, 2024, 7:42am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/5 "2024-10-22T07:42:29Z")

</div>

It already says:

> for `handleLengthMTL operMTL` to type check we need `m'` to be `ExceptT String m`

Do you mean I should specifically say this is what GHC infers?

---

<div class="post-metadata">

**Author:** ![sgraf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/sgraf/32/392_2.png) [@sgraf](https://discourse.haskell.org/u/sgraf)\
**Post date:** [October 22, 2024, 7:56am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/6 "2024-10-22T07:56:19Z")

</div>

Then it appears I just should have read more carefully 🙂

---

<div class="post-metadata">

**Author:** ![tomjaguarpaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/tomjaguarpaw/32/1230_2.png) [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Post date:** [October 22, 2024, 7:59am UTC](https://discourse.haskell.org/t/plucking-constraints-in-bluefin/10579/7 "2024-10-22T07:59:49Z")

</div>

You read carefully enough to find the type error, which I appreciate!
