Is there a way I can find the type of shift in the code below by rewriting the instance below? Is the reason I cannot find its type when I try to call it below because it is a local binding (in the where construct)?
class CoMonad m where
extract :: m a -> a
(<<=) :: (m a -> b) -> m a -> m b
instance (Monoid s) => CoMonad ((->) s) where
extract = ($ mempty)
f <<= r = \ t -> (f . shift t) r
where shift t rr = \ s -> rr (s <> t)
:t shift
<interactive>:1:1: error: Variable not in scope: shift