termToInt :: Term -> Maybe Int
termToInt (Atom s) = case B8.readInt s of
  Nothing -> Nothing
  Just (i, rest) -> if B.null rest then Just i else Nothing
termToInt :: Term -> Maybe Int
termToInt (Atom s) = case B8.readInt s of
  Nothing -> Nothing
  Just (i, rest) -> if B.null rest then Just i else Nothing
termToInt (Atom s) = case B8.readInt s of
  Nothing -> Nothing
  Just (i, rest) -> if B.null rest then Just i else Nothing