I am trying to learn some Haskell by looking at a superb short and educational article on comonad application from 2006 link and it contains an expression like rule (U (a:_) b (c:_)) = not (a && b && not c || (a==b)) whre U is a zipper comonad. That is stated in data U x = [x] x [x] and accompanying implementations of the comonad operations.
Trying to learn more, I am attempting to annotate the type of the expression manually. A wise choice seems to be rule :: U Bool -> Bool, but that seems a bit... restrictive. I could imagine other types that would be able to have truthyness values, such as Ints (0 corresponds to false, all other values could be True) and other.
If there was a type class for truthyness called truthy, I guess I could write rule :: (Truthy t) => U t -> Bool. Since I want to iterate over rule, the first type annotation (rule :: U Bool -> Bool) is good enough, but still the question tickles my brain.
Is there such a typeclass? If there is, what is it called? If not, why is there no need for it?