parseTerm :: String -> Maybe Term
parseTerm str =
  case readP_to_S (do t <- term; eof; return t) str of
    [(t, "")] -> Just t
    []        -> Nothing
    parses    -> error $ "multiple parses: " ++ show parses
parseTerm :: String -> Maybe Term
parseTerm str =
  case readP_to_S (do t <- term; eof; return t) str of
    [(t, "")] -> Just t
    []        -> Nothing
    parses    -> error $ "multiple parses: " ++ show parses
parseTerm str =
  case readP_to_S (do t <- term; eof; return t) str of
    [(t, "")] -> Just t
    []        -> Nothing
    parses    -> error $ "multiple parses: " ++ show parses