On Thu, Dec 22, 2011 at 14:44, Dennis Raddle <dennis.raddle@gmail.com> wrote:
test :: Int -> Either String String
test x = do
  y <- case M.lookup x testMap of
         Nothing -> throwError "not in map"
         Just z -> return z
  return y

> test x = maybe (Left "not in map") Right $ M.lookup x testMap

--
brandon s allbery                                      allbery.b@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms