try_evaluate_expression :: RpnStack -> VariableMap -> Either RpnStack Double
try_evaluate_expression stack varMap = 

  if can_evaluate stack 
    then
      Right $ rpn_compute (SymbolTable M.empty varMap) 0.0 stack 
    else
      Left stack

  where

    can_evaluate = null . filter unknown_element . toList 
      where
        unknown_element x = case x of
                              Time       -> True
                              Variable v -> if v `elem` M.keys varMap
                                            then False
                                            else True
                              _          -> False
try_evaluate_expression :: RpnStack -> VariableMap -> Either RpnStack Double
try_evaluate_expression stack varMap = 

  if can_evaluate stack 
    then
      Right $ rpn_compute (SymbolTable M.empty varMap) 0.0 stack 
    else
      Left stack

  where

    can_evaluate = null . filter unknown_element . toList 
      where
        unknown_element x = case x of
                              Time       -> True
                              Variable v -> if v `elem` M.keys varMap
                                            then False
                                            else True
                              _          -> False
try_evaluate_expression stack varMap = 

  if can_evaluate stack 
    then
      Right $ rpn_compute (SymbolTable M.empty varMap) 0.0 stack 
    else
      Left stack

  where

    can_evaluate = null . filter unknown_element . toList 
      where
        unknown_element x = case x of
                              Time       -> True
                              Variable v -> if v `elem` M.keys varMap
                                            then False
                                            else True
                              _          -> False