I want to use 'lookup' inside an Either String monad. So I want to write
something like
eitherLookup :: Eq a => String -> a -> [(a,b)] -> Either String b
eitherLookup s x ps = case lookup x ps of
Just y -> Right y
Nothing -> Left s
Is there such a function existing?
Thanks,
Mike