Hi!
\begin{code}
module Exh3 where
class Monad m => StateMonad s m where
getState :: m s
setState0 :: forall b.(StateMonad (a,b) m => m a)
setState0 = getState >>= \ (l,_r) -> return l
\end{code}
yields: TcType.lhs:313: Non-exhaustive patterns in lambda
Cheers,
Michael
BTW: Yes, sometimes I prefer randomly shuffling source code
instead of thinking about why this can't work ;-)
--
The First Commandment for Technicians:
Beware the lightening that lurketh in the undischarged capacitor,
lest it cause thee to bounce upon thy buttocks in a most untechnician-like
manner. -- fortune cookie