use :: Int -> M ()
use n = do st <- get
           let seen = stSeen st
           put $ st { stSeen = Set.insert n seen, stLast = Just n }
           if (n `Set.member` seen)
               then problem ("Duplicate " ++ show n)
               else case stLast st of
                    Just l
                     | (l > n) ->
                        problem ("Decreasing order for " ++ show l
                                               ++ " -> " ++ show n)
                    _ ->
                        return ()
use :: Int -> M ()
use n = do st <- get
           let seen = stSeen st
           put $ st { stSeen = Set.insert n seen, stLast = Just n }
           if (n `Set.member` seen)
               then problem ("Duplicate " ++ show n)
               else case stLast st of
                    Just l
                     | (l > n) ->
                        problem ("Decreasing order for " ++ show l
                                               ++ " -> " ++ show n)
                    _ ->
                        return ()
use n = do st <- get
           let seen = stSeen st
           put $ st { stSeen = Set.insert n seen, stLast = Just n }
           if (n `Set.member` seen)
               then problem ("Duplicate " ++ show n)
               else case stLast st of
                    Just l
                     | (l > n) ->
                        problem ("Decreasing order for " ++ show l
                                               ++ " -> " ++ show n)
                    _ ->
                        return ()