combine_ST_and_M = do lift (fooM undefined) --fooM is something of type a -> M a s () ref <- lift $ new_ref "A" return ref why doesn't this work? Couldn't match expected type `M a s' against inferred type `ST s1' Expected type: t1 (M a s) t Inferred type: t1 (ST s1) (STRef s1 [Char]) In a 'do' expression: ref <- lift $ (new_ref "A") In the expression: do a <- lift (fooM undefined) ref <- lift $ (new_ref "A") return ref