Why doesn't the case with (-1)
work here:
λ> (+1) <$> Right 10
Right 11
Prelude
λ> (-1) <$> Right 10
<interactive>:22:1: error:
• Non type-variable argument in the constraint: Num (a -> b)
(Use FlexibleContexts to permit this)
• When checking the inferred type
it :: forall a b a1. (Num (a -> b), Num a) => Either a1 b
Prelude
λ> (*1) <$> Right 10
Right 10
Prelude
λ> (/1) <$> Right 10
Right 10.0
Prelude
λ>