-- a generic counter
freshInt :: Monad m => StateT Int m Int
freshInt = do
  x <- get
  () <- put (x+1)
  return x
freshInt :: Monad m => StateT Int m Int
freshInt = do
  x <- get
  () <- put (x+1)
  return x
freshInt = do
  x <- get
  () <- put (x+1)
  return x