Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here. Can anyone see if the following definition:

```decide :: Comonad f => f (Either a b) -> Either (f a) (f b)
decide fx = case extract fx of
Left  a -> Left  \$ either id (const a) <\$> fx
Right b -> Right \$ either (const b) id <\$> fx
```

lightly edited from the final snippet here (which doesn't typecheck and might have a typo) ```symm :: Either a b -> Either b a
symm = either Right Left

lcostrength :: Comonad f => f (Either a b) -> Either a (f b)
lcostrength fab = case extract fab of
Left  a -> Left a
Right b -> Right \$ const b <\$> fab

rcostrength :: Comonad f => f (Either a b) -> Either (f a) b
rcostrength = symm . lcostrength . fmap symm

decide1 :: Comonad f => f (Either a b) -> Either (f a) (f b)
decide1 = lcostrength . fmap rcostrength . duplicate

decide2 :: Comonad f => f (Either a b) -> Either (f a) (f b)
decide2 = rcostrength . fmap lcostrength . duplicate

-- decide1 = decide2 =? decide
``` 1. Shouldn't `const b <\$> fab` be `either (const b) id <\$> fab`?
2. This looks easily quickcheckable. @Lysxia Do you mean that `const b <\$> fab` wouldn't typecheck or that it's wrong despite typechecking? Oh, right. I get what's wrong with `const b` now. It'll overwrite stuff that we don't need to overwrite