{-@ LIQUID "--no-totality" @-} module Compose where data ST s a = ST {runState :: s -> (a,s)} {-@ data ST s b b -> Bool> = ST (runState :: x:s -> (b, s)) @-} class MM m where bind :: m a -> (a -> m b) -> m b cmp :: m a -> m b -> m b instance MM (ST s) where cmp m f = bind m (\_ -> f)