isIn msg x ys
  = elem100 0 x ys
  where
    elem100 :: Eq a => Int -> a -> [a] -> Bool
    elem100 _ _ [] = False
    elem100 i x (y:ys)
      | i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
      | otherwise = x == y || elem100 (i + 1) x ys
isIn msg x ys
  = elem100 0 x ys
  where
    elem100 :: Eq a => Int -> a -> [a] -> Bool
    elem100 _ _ [] = False
    elem100 i x (y:ys)
      | i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
      | otherwise = x == y || elem100 (i + 1) x ys
isIn msg x ys
  = elem100 0 x ys
  where
    elem100 :: Eq a => Int -> a -> [a] -> Bool
    elem100 _ _ [] = False
    elem100 i x (y:ys)
      | i > 100 = trace ("Over-long elem in " ++ msg) (x `elem` (y:ys))
      | otherwise = x == y || elem100 (i + 1) x ys