displayMenuOfValues :: [(String,a)] -> IO (Maybe a)
displayMenuOfValues items = do
 vty <- allocate
 (vty',maybePos) <- work 0 0 (map fst items) vty
 deallocate vty'
 case maybePos of
  Just pos -> return $ Just $ snd $ items !! pos
  Nothing -> return Nothing

--main = do
-- choice <- displayMenu ["Hi","Bye","The other thing."]
-- print choice
-- the main program
displayMenuOfValues :: [(String,a)] -> IO (Maybe a)
displayMenuOfValues items = do
 vty <- allocate
 (vty',maybePos) <- work 0 0 (map fst items) vty
 deallocate vty'
 case maybePos of
  Just pos -> return $ Just $ snd $ items !! pos
  Nothing -> return Nothing

--main = do
-- choice <- displayMenu ["Hi","Bye","The other thing."]
-- print choice
-- the main program
displayMenuOfValues items = do
 vty <- allocate
 (vty',maybePos) <- work 0 0 (map fst items) vty
 deallocate vty'
 case maybePos of
  Just pos -> return $ Just $ snd $ items !! pos
  Nothing -> return Nothing

--main = do
-- choice <- displayMenu ["Hi","Bye","The other thing."]
-- print choice
-- the main program